Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basepath is set to "/" but should be "" or omitted #157

Closed
sandorfr opened this issue Aug 17, 2016 · 3 comments
Closed

Basepath is set to "/" but should be "" or omitted #157

sandorfr opened this issue Aug 17, 2016 · 3 comments

Comments

@sandorfr
Copy link
Contributor

Currently, with the default configuration, basePath is set to / and operation paths start with a slash (this is fine and a swagger requirement).

The basePath specification it states The base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). The basePath does not support path templating.

From what I understand, basePath should be falsy (undefined or empty) in that case and set only if there is an actual basePath and should not have a trailing slash.

Swagger specification states : The path is appended to the basePath in order to construct the full URL.

If we strictly follow that specification it generates a double slash at path root.

This is not a big deal of course but I wonder if you would accept a PR to fix that.

@sandorfr sandorfr changed the title Basepath is set to "/" but should be "" Basepath is set to "/" but should be "" or omitted Aug 17, 2016
@sandorfr
Copy link
Contributor Author

sandorfr commented Sep 8, 2016

Looks like it has been fixed one way or another in latest build.

@sandorfr sandorfr closed this as completed Sep 8, 2016
@sandorfr sandorfr reopened this Nov 14, 2017
@sandorfr
Copy link
Contributor Author

I noticed that this is still happening on the v1. Unless I'm mistaken, If we follow the spec it gives computed url such as http://example.org//api/endpoint (notice the double slash).
From what I understand it should be omitted in most cases.

I'm curious about an explanation of why it behaves like that.

@domaindrivendev
Copy link
Owner

Fixed by 2255ef9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants