Forum Discussion

christopheAtMak's avatar
New Contributor
4 years ago

Swager codegen for spring boot: how is swagger-ui page generated


I was wondering how the swagger-ui page was generated, mostly how the various annotations where used to build the page.

I am facing a fairly large number of defects (at least I beleive these are defects) and if I could find y way around the HTML generation it certainly would help me either pinpoint a defect somewhere or understnd what I do not do right


One of my issues is that the nullable properties of fields in output aggregates is ignored.


The other is the errors displayed by the page when an aggregate is diffined as an arrau

   type: array

      $ref: '#/components/schemas/opt-out-media'

Spring doc (or is it spring fox)  displays a error


Any pointer is welcome






1 Reply

  • Hi Christophe,


    I'm trying to follow the details of your question, but a bit confused by the details. This answer may not be complete, but please feel free to follow up with details I might have missed.


    Both Springdoc and Springfox are third party libraries with which we cannot directly help. We simply don't have the technical knowledge of them to provide such support. If you encounter any issues dealing with them directly, you should file tickets in their github repositories.


    Swagger UI is indeed our tool. We don't provide a direct way of integrating it with Java projects, but at the end of the day, it's just a static set of files that need to be hosted with your app. To clarify, HTML is not being generated as a static file, but rather Swagger UI is a JavaScript based application that reads your API definition (Swagger 2.0 or OpenAPI 3.0) and renders it. Springfox does provide a webjar of Swagger UI and you'll need to check their docs on how to include it. If you want to use Swagger UI directly, you can find instructions here.