OpenAPI-Specification icon indicating copy to clipboard operation
OpenAPI-Specification copied to clipboard

Clarification required for templated paths with same hierarchy but different templated names and methods

Open Jmcleodfoss opened this issue 3 years ago • 1 comments

This is alluded to by @kapone89 in Issue 2015 but I believe it warrants an issue of its own to get clarification.

The spec states clearly that "Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical."

But what it there are there are two templated paths which differ by templated names and also HTTP methods? There is no ambiguity between them, as long as there is only a single path for each method, so I can't see any justification for disallowing this; the example provided by in Issue 2015 is:

GET /pets/{petId}
DELETE /pets/{name}

Jmcleodfoss avatar Apr 09 '21 13:04 Jmcleodfoss

My understanding is that the template names don't affect the detection of a hierarchy, but the method and non-templated path components do. And I agree we should clarify this.

So,

GET /{users} and GET /{names} are identical / ambiguous, but GET /{user} and PUT /{user} are not.

MikeRalphson avatar Apr 10 '21 06:04 MikeRalphson