-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Clarification on path templates that overlap another path #1127
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
Comments
It's not supported (I believe) so perhaps the documentation needs updating. If the path mapping is not deterministic, the definition does little good. @webron ? |
Wow, I'm glad I asked. Unless I'm missing something, the ubiquitous pet store example I mentioned uses this pattern in two different places:
This lead me to believe it is probably supported by all the tooling, even if not officially defined in the spec. |
I hope this will continue to be allowed. It is not prohibited in paths object (or in 2.0 or the existing toos) so adding such a restriction now would be a breaking change. The mapping is deterministic, just as a regular expression |
@lmsurpre Your initial idea is correct. A concrete path definition will take precedence over a templated path - there could never be ambiguity in path patching, so it's not an issue. We can clarify the wording in the spec. |
Clarification merged. |
It seems that tools to validate OAS, still seems to validate these endpoints, and do not mark them as ambiguous nor wrong. Example endpoints with same methods:
|
@kinvaris feel free to file an issue on the OAI/oascomply repository for anything you see tools handling strangely that you'd like the (still under development) compliance tool to check. |
Apologies if I'm missing something obvious, but I was trying to find a definitive statement that describes whether/how overlapping paths should work. For example, consider two paths like:
I browsed the spec but didn't see it. I browsed through Issue #574 and related issues, but those seem to cover more advanced cases.
I think its generally understood that this is supported (just look at http://petstore.swagger.io/) and that the concrete/fixed path(s) takes 'precedence' over the path template or path wildcard, but I was just looking for some re-assurance from the spec. Hopefully something I just missed?
The text was updated successfully, but these errors were encountered: