swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.37k stars 8.92k forks source link

Swagger-UI Rendering Issue - [Maximum call stack size exceeded] #9307

Open PhoenixFlash10 opened 11 months ago

PhoenixFlash10 commented 11 months ago

Q&A (please complete the following information)

Swagger/OpenAPI definition: NONE-NA

Swagger-UI configuration options: NONE-NA

How can we help?

My POJO for Response is a big object and when I try to hit a GET or a POST request I see swagger-ui rendering errors like below :

RangeError: Maximum call stack size exceeded

something similar to what is mentioned here and here.

I am on JDK 11 and SpringBoot 2.7.13, so I can't use openAPI 3, I have to stick with above versions. What do you advise here please?

### Quick Note - The response object is too large with a lot of hierarchies.

PhoenixFlash10 commented 11 months ago

What I have tried till now :

  1. @Parameters(hidden=true)
  2. SpringDocUtils.....addAnnotationsToIgnore()
  3. springdoc.swagger-ui.default-models-expand-depth=-1

None of the above could solve my problem!!