Forum Discussion

Aleridia's avatar
Aleridia
Visitor
5 years ago

Swagger codegen/Swagger editor don't want to generate example

Hello,   I'm learning Swagger and I had a problem while building my application. Indeed, the auto-generate code don't want to generate my examples (I generated only Spring server).   Here is the...
  • frantuma's avatar
    4 years ago

     I am not sure I fully understand the issue, however if I get this correctly you are generating a spring server stub using the "spring" generator; and your second screenshot is the swagger-ui embedded into the result code. Each generator behaves differently and has different capabilities, in this case the generated server code is using springfox project to expose a Swagger definition resolved from the Api/Controller code. The generated code doesn't add for example annotations to define the possible examples for the endpoints, as found in the original definition.