简体   繁体   中英

Springfox Swagger vs Swagger maven plugin

There are Springfox implementation of the Swagger 2 specification and Swagger Maven Plugin . What's the difference between them? When should I prefer one over another?

Swagger maven plugin generates the swagger specification from Java annotations.

Springfox generates a whole web-based UI from Java annotations, with documentation, samples and functionality to try the operations out.

The most obvious difference I see is that SpringFox doesn't require you to manually swagger-annotate classes as swagger-maven-plugin does.

The second one is the swagger spec generation time:
compilation time vs build phase, respectively.

SpringFox
Without any handwritten documentation, it can generate a lot of information about your API just by inspecting classes in your application.

Swagger and SpringFox

Swagger-maven-plugin
Enables your Swagger-annotated project to generate Swagger artifacts during the maven build phase. It generates the spec as a build artifact to be used in downstream Swagger tooling.

Swagger-Maven-Plugin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM