You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
sandorfr
changed the title
Basepath is set to "/" but should be ""
Basepath is set to "/" but should be "" or omitted
Aug 17, 2016
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.
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.
The text was updated successfully, but these errors were encountered: