redoc
redoc copied to clipboard
Json example showing null in an array of string instead of properties with string values.
Describe the bug We're experiencing issues with Redocly. Json example showing null in an array of string instead of properties with string values. We're using the same code and swagger schema everywhere, but it's not working in some places while getting json example from [FromBody] parameter of API. As shown in the screenshots.
Expected behavior

Screenshots

Additional context We have used Swashbuckle.AspNetCore.ReDoc 6.4.0.
Could you please help with this?
Can you share the corresponding OAS to reproduce?
Hello @adamaltman / @AlexVarchuk
Please find below screenshots of OAS to reproduce this issue.
Screenshots:
- We have configured the below settings in the startup.cs file.

- swagger.json response

Hello @adamaltman / @AlexVarchuk
Any updates on the above issues?
Hello @adamaltman / @AlexVarchuk / @joshprice Is there an update on the above issue?
I'm currently facing the same issue, anyone have any idea what might the cause of the bug?
After debugging on my own, I found the problem in src/services/models/MediaType.ts on line 79:
Before this line, I already checked that this.schema and parser.spec have the correct data. However, after the creation of default, it doesn't have the correct value.
The value is processed by Sampler, which is imported from openapi-sampler.
Here’s the breakdown of what I observed:
- Before Line 79:
this.schemahas the correct data.parser.spechas the correct data.
- After Line 79:
defaultdoes not have the correctvalue.
the last object of the value shouldn't be undefined, it should contains another object
It seems the issue lies within how Sampler.sample processes the schema and spec. Any insights or suggestions on how to resolve this would be appreciated.
you just need to set the value of redoc configuration generatedPayloadSamplesMaxDepth into something higher than 10