Forum Discussion

RichardHobbs's avatar
RichardHobbs
New Member
4 years ago
Solved

Swagger UI not showing operations with same Path but different HTTP method

For example I have 2 API operations:

GET v1/people/{id}

POST v1/people/{id}

Only one of these operations is shown in my Swagger UI API docs but I want both of them displayed. I have many examples where this is the case. In the Swagger documentation it states:

"Swagger defines a unique operation as a combination of a path and an HTTP method."

This would make me think what I want to do is possible as they are uniquely identified by the HTTP method.

If I change the path parameter for one in my swagger.yaml file they will both show. eg:

GET v1/people/{personid}

POST v1/people/{id}

But I would rather keep them all standard otherwise my API docs will appear messy.

I am using swagger-ui-express 4.1.4.

 

Please see StackOverflow post with code: https://stackoverflow.com/questions/62769866/swagger-ui-not-showing-operations-with-same-path-but-different-http-method

 

Thanks for your help.

  • Hi RichardHobbs ! It looks like you already got an answer to your question on Stack Overflow!


    BTW, swagger-ui-express isn't SmartBear's project. It's better to ask questions about this tool in their own community.

1 Reply

  • sonya_m's avatar
    sonya_m
    SmartBear Alumni (Retired)

    Hi RichardHobbs ! It looks like you already got an answer to your question on Stack Overflow!


    BTW, swagger-ui-express isn't SmartBear's project. It's better to ask questions about this tool in their own community.