-
Notifications
You must be signed in to change notification settings - Fork 9k
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
nested relationship not displayed correctly #5972
Comments
I have the same issue (I use swagger-ui and not the editor), and I agree that the allOf is where the problem is. If you remove it, it shows the missing fields of your referenced property member. You directly reference the object in your response (you can fiddle with the attached file) it will also show the object correctly. Glitching the matrix
Works fine
I've checked that my specs validate with
And that works, I've also used another viewer and that one shows show the correct data. In the schema view of the object I also get an incorrect schema view. I've added my reproduction path as well. |
It actually is solvable by changing some order: if you make sure, that the |
Ensure that the paths property comes before the components property, as this may lead to several strange display bugs in swagger-ui. See swagger-api/swagger-ui#5972 or swagger-api/swagger-ui#3325 (comment) Closes nestjs#1369
This is indeed a solution that fixes the issue. However, in some cases you can not change the spec because it is autogenerated (in my case https://docs.nestjs.com/openapi/introduction). Any idea about what to do in those cases? |
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-Editor configuration options:
none
Describe the bug you're encountering
in the preview for the users GET request, not all fields are displayed.
To reproduce...
paste the above swagger file into the editor and see the rendered result.
Expected behavior
all fields should be displayed which are defined in the swagger file.
Screenshots
this is the output with missing fields:
also the schema is not displaying those fields:
interestingly enough, in the
Schemas
section of the editor, everything gets resolved properly:Additional context or thoughts
I searched if some similar bug is/was happening already, the closest i found were swagger-api/swagger-editor#1892 and swagger-api/swagger-js#1394 but for the first one, i'm not sure if its the same issue. and changing the order also does not help here in this case.
the problem arises, when a list/array has items of objects, which are composed by other objects (referenced with
allOf
), which in turn also already were built out of other objects.why do i need this? the shown swagger file is actually the condensed version of our system, which contains a user permission model. we need those different levels of inheritance to properly document also POST and PATCH requests.
The text was updated successfully, but these errors were encountered: