cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
New Member

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-di...

 

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

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

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.


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

1 REPLY 1
Highlighted
Community Manager

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

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.


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors
Top Kudoed Posts