Skip to content

Properly append template to a base path with a trailing slash#52

Open
afflerbach wants to merge 1 commit into
Maks3w:masterfrom
sevenval:master
Open

Properly append template to a base path with a trailing slash#52
afflerbach wants to merge 1 commit into
Maks3w:masterfrom
sevenval:master

Conversation

@afflerbach

Copy link
Copy Markdown

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

@Maks3w

Maks3w commented Jul 30, 2018

Copy link
Copy Markdown
Owner

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
Copy Markdown
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

Maks3w commented Jul 31, 2018

Copy link
Copy Markdown
Owner

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

Maks3w commented Jul 31, 2018

Copy link
Copy Markdown
Owner

@afflerbach

Copy link
Copy Markdown
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