Skip to content
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

Add option to show operationId #1274

Open
marclave opened this issue Mar 21, 2024 Discussed in #1209 · 6 comments
Open

Add option to show operationId #1274

marclave opened this issue Mar 21, 2024 Discussed in #1209 · 6 comments

Comments

@marclave
Copy link
Member

marclave commented Mar 21, 2024

Discussed in #1209

Originally posted by ninanator March 15, 2024

Feature Request

I would like to be able to show the operationId in the UI. This will allow developers who use auto-generated clients to be able to quickly reference the operationId, since that it is how they know the endpoint. Since this is more of a niche request, I think it would be fair to make this an optional value that can be toggled at the client level.

Examples

Swagger UI

Located on right side of entry

See: https://petstore.swagger.io/?displayOperationId=true

Redocly

Located in the URL

See: https://redocly.com/docs/openapi/petstore/pet/uploadFile/

Readme.io

Located in the URL

See: https://pet-store-api-explorer.readme.io/reference/uploadfile

Proposed Positioning

Screenshot 2024-03-15 at 6 32 55 PM

I think, based on the other elements already on the page, that this location would be the least disruptive. It could be above the description value and potentially italicized.

Thank you!

@aditya-67
Copy link

aditya-67 commented Mar 22, 2024

@marclave I see that endpoints in the Sidebar are referenced via a combination of tags, method and path like this #tag/{tagName}/{method}/{path}.

Screenshot 2024-03-22 at 09 27 06 Screenshot 2024-03-22 at 09 27 21

I'm just curious to understand more on the decision to use tags in the URLs.

Could this use the operationID directly in the URL, #operation/{operationID}? If operationID is not present, we use a combination path and method like this #path/{path}/{method} to maintain uniqueness. Attaching some screenshots for reference.

I think it can be much easier to access an API endpoint via an operationID, given the uniqueness of it. More context here

Please let me know your thoughts on this

Screenshot 2024-03-22 at 09 46 52 Screenshot 2024-03-22 at 09 47 03 Screenshot 2024-03-22 at 09 46 05 Screenshot 2024-03-22 at 09 45 24

@marclave
Copy link
Member Author

marclave commented Apr 4, 2024

@aditya-67 really sorry I missed this!

I really appreciate your comment and all the added context.

@amritk thoughts on conditional router based on if operationId is present?

@amritk
Copy link
Member

amritk commented Apr 8, 2024

I think we should be able to do it, something like /operation/${id}. Will require some changes though

@arthurfiorette
Copy link
Contributor

Hey! any updates on this?

@amritk
Copy link
Member

amritk commented May 1, 2024

Sorry @arthurfiorette not at the moment, @marclave what do you think?

@hanspagel
Copy link
Member

I think we should even consider to make it the default, and the current way the fallback. 🤔

But it might take some time, as it touches quite a few places and would be a breaking change. Maybe something for a version 2.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants