We develop our services API first, so we use that to generate code rather than our code generating the API. Pros and cons to both of course. Part of the reason is I don’t like having Springfox in the dependency tree. Bloats the Jar file AND memory usage for each instance of the Service.
I’d strongly suggest dropping swagger-codegen and moving to
https://github.com/OpenAPITools/openapi-generator.
Quick backstory. Most of the contributors to openapi-generator worked on swagger-codegen but didn’t like the direction SmartBear was taking with the generator when they took over.
So it started as a fork, and is now much better. Supports both V2 and V3 specs with one generator for starters.
But if you’re working with a generated API, then it doesn’t really help with your original problem.