-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
ReDoc fails to expand JSON Schema refs in examples #840
Comments
Your spec is incorrect according to the OpenAPI 3.0 spec.
In order to use Here is the updated gist: https://gist.github.com/RomanGotsiy/29152ff5a4da68dbb49131eaaf347530 Closing this issue. Feel free to continue the discussion here. The new ReDoc version is coming tomorrow. |
This was also a point of contention in Swagger-UI. swagger-api/swagger-ui#4924 (comment) While I would prefer that |
It will work using |
|
@RomanHotsiy the gist you provided https://gist.github.com/RomanGotsiy/29152ff5a4da68dbb49131eaaf347530 seems to have been deleted. Any chance you can provide an example of how examples and $ref should work with redoc? I'm using version 2.0.0-rc.18, and having some issues displaying it. |
TL;DR It works if you use
|
@jaspersorrio Would you mind including that in the context of the original gist? I'm not sure where to add that to get it to render properly in ReDoc. |
Related to #311 and #380
I'm using external schema and example files to reuse them in multple operations. ReDoc correctly render example code for the first operation, but fails to render subsequent ones, rendering something like this:
As @vegyraupe commented in #380:
You asked for a reproducible example, so a created this Gist to help.
I tested the example spec with "redoc-cli serve", "redoc-cli bundle" and "speccy serve", all result in the same problem.
In the final bundled spec file, the schema and example code are included in the first operation, but the other ones have just a reference to the first operation:
As you can see, both schema and example have a reference to the first operation. ReDoc can render the schema for all operataion (it follows the $ref) but don't do the same for the example.
The text was updated successfully, but these errors were encountered: