Swagger: "equivalent path already exists" despite various options

I am trying to turn the Atom Publishing Protocol (RFC5023) into the Swagger / OpenAPI specification to use these specifications.

I ran into the following problem: in Atom there are different types of URIs, for example. Collections and Membership URIs. My idea was to document this as follows:

paths: /{CollectionURI}: get: summary: List Collection Members ... post: summary: Create a Resource ... parameters: - $ref: "#/parameters/CollectionURI" /{MemberURI}: get: summary: Retrieve a Resource ... parameters: - $ref: "#/parameters/MemberURI" 

When I do this, the swagger editor claims that

An equivalent path already exists: / {MemberURI}

These are different types of URIs that return different things when requested. I want to name them differently to document them individually.

Is there any way to do this?

Thanks!

EDIT: The spectrum just shows up in Swagger-UI - is it an error in the editor or is the user interface just ignoring my error?

+5
source share
1 answer

This is because the two paths may be the same. I understand that parameters can uniquely identify them, but Swagger 2.0 does not support full URI patterns, and only part of the path is checked for uniqueness. So:

 /{foo} /{bar} 

identical, even if foo should be a string and bar should be a number. Please add your $ 0.02 to the OpenAPI Specification Repo , as we are currently working on better path support.

+6
source

Source: https://habr.com/ru/post/1243308/


All Articles