Redocly / redoc

📘 OpenAPI/Swagger-generated API Reference Documentation
https://redocly.github.io/redoc/
MIT License
23.65k stars 2.31k forks source link

Dependecy refs #2620

Open hacan359 opened 2 days ago

hacan359 commented 2 days ago

Describe the bug I am experiencing an issue with ReDoc where nested objects are rendered inconsistently at different levels of depth in my API documentation. Specifically, I have defined a set of objects in my OpenAPI specification, and while they render correctly at one level of nesting, they do not render correctly at deeper levels.

Details: I am using the same object definitions throughout my OpenAPI specification. At a certain level of nesting, the objects display their properties correctly, but at deeper levels, the objects are rendered incorrectly or not at all. This inconsistency makes it difficult for users to understand the API structure and the data being returned. Example: Correct Rendering: At level 1, the object displays all properties as expected. Incorrect Rendering: At level 2 or deeper, the object appears as an empty object {} or does not show its properties.

Screenshots Image

Additional context I use last version readoc https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js

audipasuatmadi commented 1 day ago

Hi @hacan359, I experience the same issue times ago. I got it fixed by configuring Redoc's generatedSamplesMaxDepth. It seems in my experience, its caused by having it reaches the max depth of the samples. Set it to like 21 or higher value and see the results.

Reference: https://redocly.com/docs/realm/config/openapi/generated-samples-max-depth

It seems it's not in the config.md of the open-source code, I will add it soon.

Hope it helps.