Justinas Jakavonis
Justinas Jakavonis

Reputation: 8838

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?

Upvotes: 3

Views: 2741

Answers (2)

neojal
neojal

Reputation: 291

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

Upvotes: 1

jbx
jbx

Reputation: 22158

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.

Upvotes: 2

Related Questions