-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
[Question] Equivalent path already exists #788
Comments
In OpenAPI 2.0, no (though there is a workaround: #146 (comment)). Related issues: #146, #164, #270. In your example, I guess the server could distinguish both variants from the presence of the query parameter or the request body, but I don't know how this would work in a general case. |
@pkupilas I'm assuming you are trying to describe an existing system that can't be changed rather that one that you are building. But just in case I'm wrong, allow me to suggest that using the type system of the implementation language to determine which operation to match is opening the door to a world of edge cases. Different languages to completely different things when it comes to coercing string literals into native types. You don't want to expose behaviour of your chosen language through your HTTP interface. Consider the following URLs and which operation they would map to:
Using an extra constant path segment to identify the desired operation is more reliable, more understandable and will perform better. Forgive me if I'm "preaching to the choir". In fact, the following syntax is completely valid, although not common, for URLs also:
|
Yes, while this is technically possible to route on a server, it's impossible, from a URI, to determine if a path segment /1/ is a string ("1") or number (1). For now, this is not supported, and it is expected that these paths are equivalent. One could provide formatting requirements to a path parameter, for example, and say that |
Is it any way to difference two similar paths with different parameter?
Swagger returs error:
Equivalent path already exists: /api/integration/message/v1/suppvouch/{id}
Example:
The text was updated successfully, but these errors were encountered: