I am learning how to integrate Swagger with Spring Boot. I have read the "whole" internet but there are some gaps in my code.
On the one hand, I use SpringFox annotations and it generates a Swagger UI I can use in the browser.
Then I use an application.yaml file which includes this code I customized form an internet example:
Here is when I get lost, I have read about Swagger "contracts". It looks like if it would suggest to generate the Swagger output by reading the .yaml file?
Okay the previous .yaml was pretty incomplete. Now I have a proper one for make post, get etc..
The thing now is that the codegen doesnt reach the file and doesnt generate any interfaces...
Lets say that in the tree project structure I have 3 file supporting swagger. It doesnt find any. In Maven there is also code for Swagger dependencies.
Okay it has beed all fixed just by customizing the pom.xml.
There another issue which looks a bit complex I think.
I have a Spring Boot controller implementing an interface. Okay, so on the other hand by using Maven and Swagger I am generating sources based in a .YAML file.
The thing is that it generates propery the interface automatically but with the generated controller it only writes the @Controller and signature without implementation. Also, in the swagger-ignore file it is not reference to avoid implementing them.
I would like :
1) Generate the controller once myself and dont override it but only when I modify the .YAML so it automatically recognizes the changes.
2) Generate it always taking way the old one an replacing it?
Is someone who has experience with this cases?
I think I'll just lie down here for a second. And ponder this tiny ad: