Springdoc-openapi: [Question] Is it possible to disable example data generation?

Created on 4 Jul 2020  路  6Comments  路  Source: springdoc/springdoc-openapi

First thanks a lot for springdoc-openapi-ui, it works great out of the box!

Because of some recursion in my data model, the example data Swagger generates is massive [1] and doesn't render at all in the browser (the tab that loaded the doc page hangs).

Is it possible to disable this generation when springdoc-openapi-ui produces the documentation?


[1] I have discovered this by trying an alternate path:

  1. Run generateOpenApiDocs from org.springdoc.openapi-gradle-plugin
  2. A valid 240KB openapi.json is generated 馃憤
  3. Run swagger-codegen generate -l html -I openapi.json
  4. A single page HTML doc is generated: it's > 3MB and is mostly composed of a completely useless example data section.

Most helpful comment

Hi @dandew,

There is no such property, but you can ask for an enhancement on the swagger-ui project:

Are you using groups (or GroupedOpenApi Bean) ?

All 6 comments

Hi @dandew,

There is no such property, but you can ask for an enhancement on the swagger-ui project:

Are you using groups (or GroupedOpenApi Bean) ?

Thanks for your reply!

I am not using groups nor any annotations besides the Spring ones (so far). Do you think using one of these annotations could help?

Which springdoc-openapi version, are you using ?

You can try the following property (if not using Oauth): This resolves a bug on swagger-ui where it loads some resources twice if using configurl as query parameter.

springdoc.swagger-ui.display-query-params-without-oauth2=true

Or if using Oauth2:

springdoc.swagger-ui.display-query-params   = true

Let us know if this improves the performance.

I'm using version 1.4.3.

I gave springdoc.swagger-ui.display-query-params-without-oauth2 a shot, since I'm not using OAuth2, but to no avail. All I see is a spinning wheel when opening the detail section of the POST request on the concerned REST controller's doc.

I would guess, it might be more related to the performance of the rendering on the client side.

There are some existing requests to improve the performance of the UI, as for example:

I am quite sure, if you provide them the relevant information they need, they could help.

Thanks a lot, I'm going to keep on eye on the progress on Swagger UI's side as it's pretty clear the issue is on that side of the fence. Again thanks for your quick support 馃檱

Was this page helpful?
0 / 5 - 0 ratings

Related issues

durimkryeziu picture durimkryeziu  路  4Comments

riimeik picture riimeik  路  4Comments

pLotoniC picture pLotoniC  路  6Comments

flamestro picture flamestro  路  3Comments

andygoossens picture andygoossens  路  6Comments