hakonruud
5 years agoOccasional Visitor
PetStore example
I am looking at the petstore-example. I am struggling to understand how annotations in the Pet.java class affect the openapi.yaml file in any way. My ideal goal would be to only need to update the code one place (in the Pet.java-file) and the, based on annotations in this file, automatically generate the openapi.yaml-file (which I understand is needed for swagger-ui). Is this possible? And can you please give me some help/guidance on this?
Hi hakonruud ,
Java annotations are provided by the Swagger Core library. Check out the Quick start guide and Java annotation examples.
In Spring apps you would typically use Springfox or springdoc-openapi which are built on top of Swagger Core.