stoplightio / elements

Build beautiful, interactive API Docs with embeddable React or Web Components, powered by OpenAPI and Markdown.
https://stoplight.io/open-source/elements/
Apache License 2.0
1.74k stars 201 forks source link

If the same endpoint has both POST and GET methods, only one of them can be accessed #2586

Closed Lhcfl closed 4 months ago

Lhcfl commented 4 months ago

If the same endpoint has both POST and GET methods, only one of them can be accessed

Context

Example: https://stelpolva.moe/api-doc#/operations/notes/reactions

As shown in the figure, when trying to view notes/reactions, both the GET and POST methods are active, and only the previous POST can be viewed.

image

Environment

brendarearden commented 4 months ago

Can you provide a copy of the openapi spec that is causing the issue?

Lhcfl commented 4 months ago

You can download it here: https://stelpolva.moe/api.json

(Sorry, a few days after this issue was issued, we temporarily switched to Redoc, resulting in the original scene not being visible.)

brendarearden commented 4 months ago

@Lhcfl looking at your spec, it appears that the operationId is the same for both your POST and GET methods. These should be unique. Could you try making those unique to see if it resolves your issue?

Lhcfl commented 4 months ago

Thanks for your help! This is indeed our problem, not following the OpenAPI spec correctly. Then this issue can be closed