Can any of you suggest any alternatives for implementing Swagger for Spring MVC based REST API? FYI, this is not Spring boot. I've tried Springfox, but IMHO it is a buggy mess.
springdoc is a much more recent library that does not have so much legacy code as Springfox. As a consequence of the first one, springdoc is actually updated regularly and the amount of open issues is relatively small (only 11 vs 270 on Springfox).
Springfox is a framework that acts as the “glue” between Swagger and Spring. It generates the specification (contract) based on your code and also deploys the Swagger UI client with your application, allowing you to immediately test your REST API.
Springfox has replaced Swagger-SpringMVC, and now supports both Swagger specs 1.2 and 2.0. The implementation classes have changed, allowing for some deeper customization, but with some work. The documentation has improved, but still needs some details added for advanced configuration.
You could try using the Swagger Maven Plugin, which is a build time annotation processor. If you're using spring-boot with JaxRS you could use Swagger-Core, which is pretty similar to SpringFox. It knows how to interpret JAX-RS annotations rather than the spring annotations. With all of these libraries that infer based on implementation or annotations, you are going to encounter bugs/problems when you have esoteric service definitions, or scenarios the library authors haven't thought about.
If your goal is just to document the RESTful endpoints, there is the excellent Spring Rest Docs, which allows you to write documentation driven by tests. It even allows you to add hand-written documentation that can augment your generated documentation. However, it keep in mind that it does not generate the service specification in a machine readable form.
That said, being the library author for SpringFox, it would be useful if you could create specific issues to problems you're encountering with SpringFox. This will help improve the library for you and anyone else encountering the same bugs/issues. You can certainly rant on stack overflow, but Im afraid that may only get your question down votes at best.
https://github.com/RabiAPI/Evalon4J
This is a command line tool for generating java restful api documentation,
NO ANNOYING CONFIGURATION AT ALL!!!
Supported frameworks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With