Skip to content

Conversation

@afflerbach
Copy link

see for example swagger-api/swagger-js#116

@Maks3w
Copy link
Owner

Maks3w commented Jul 30, 2018

I'm about to decline this as per the specification you can infer all paths must always to start with a leading slash

basePath

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.

Path object

A relative path to an individual endpoint. The field name MUST begin with a slash. The path is appended to the basePath in order to construct the full URL. Path templating is allowed.

https://swagger.io/specification/v2/

@afflerbach
Copy link
Author

This PR is about trailing slashes. With the current master it is currently not possible to validate any path if the base path is set to /. For example /my/path will be resolved to //my/path and won't ever match.

@Maks3w
Copy link
Owner

Maks3w commented Jul 31, 2018

I understand. What I see basePath is not required.

If it is not included, the API is served directly under the host

So I think the correct is not publish a basePath when is on the root and may yo fix this library for to treat the as optional that attribute

@Maks3w
Copy link
Owner

Maks3w commented Jul 31, 2018

@afflerbach
Copy link
Author

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

Successfully merging this pull request may close these issues.

2 participants