18

For enabling Swagger in SpringBoot 2.7 what are the advantages/disadvantages of choosing springdoc-openapi over Springfox

Deepjyoti Dutta
  • 201
  • 1
  • 2
  • 7

2 Answers2

37

This might be considered opinion-based, but actually there are facts supporting the usage of springdoc over Springfox. Some of them:

  • 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).
  • It simply works easily and without major issues in the most recent Spring Boot versions.
  • Springfox seems abandoned, to say the least.

At least this is my view.

João Dias
  • 16,277
  • 6
  • 33
  • 45
3

As João Dias has correctly pointed out, Springfox is not maintained.

As a result of that, Springfox libraries don't work with Spring Boot 3.0.x. It is unclear who is going to fix it and whether it will be fixed at all.

At the moment (January 2023) it seems that the developer of a Spring Boot 3.0.x application willing to generate OpenAPI-compliant docs with Swagger is left with two options: a) Switch back to Spring Boot 2.7 and use Springfox for Swagger b) Choose Springdoc over Springfox

Girts Strazdins
  • 848
  • 9
  • 15