29

Last two years I worked on Spring Boot Applications with Springfox. Springfox generate a documentation and a test ui for your REST API. This was awesome.

But actually Springfox project is dead and do not support the newest Spring. I have three questions

  1. Is there any other way to generate Swagger UI directly? Any other library/project?
  2. How do you implement swagger ui into your Spring Boot project?
Tristate
  • 1,498
  • 2
  • 18
  • 38

3 Answers3

29

I haven't tried it myself yet, but this looks quite promising:

https://github.com/springdoc/springdoc-openapi

OpenAPI 3.0 is the successor of Open API 2.0 (sometimes referred to as Swagger, though that is actually the tooling around Open API). Not sure how much this project offers in terms of customization and how mature it is, but I guess it's worth a try ;-)

Update:
Since version 3, Spring Fox offers support for Open API 3. Please see the release log for more details.

  • 2
    `Springdoc-openapi` is indeed superior over `springfox`, but your sentence "OpenAPI is the successor of Swagger" is factually wrong. **OpenAPI** is a specification, **Swagger** is a bunch of tool. See https://swagger.io/blog/api-strategy/difference-between-swagger-and-openapi/ . – Honza Zidek Sep 23 '21 at 11:28
  • You're right, of course. I've updated the answer to clarify that misconception. – Sebastian Heikamp Sep 24 '21 at 15:21
  • Thanks! I would not mind if you said "`springdoc-openapi` is the successor of `springfox`", because to me it looks like it. In my opinion `springfox` simply missed the train. We migrated to `springdoc-openapi` from `springfox` and do not intend to go back, even if there is already also OpenAPI 3.0 support. – Honza Zidek Sep 27 '21 at 07:45
6

Spring doc Open API is alternative going forward.

  1. SpringDoc OpenAPI supports OAS 3.0
  2. Supports more annotations like @MatrixParam which was not supported in springfox.
  3. Spring boot 2.2.x works only with springdoc.

Refer the below link

https://techsparx.com/software-development/openapi/spring-boot-rest-api-docs.html

VIJ
  • 1,516
  • 1
  • 18
  • 34
  • springfox 3.0.0 now supports spring-boot 2.2.x (actually it's a prerequisite to this version) - https://github.com/springfox/springfox/releases/tag/3.0.0 – Y. Sobelman Jan 19 '21 at 21:53
  • Your link https://techsparx.com/software-development/openapi/spring-boot-rest-api-docs.html does not mention Springdoc. Author walks through manually creating OpenAPi spec and then second approach is generating from code. He uses Springfox to do so. – nabster May 24 '21 at 02:17
-1

https://github.com/RabiAPI/Evalon4J

This is a command line tool for generating java restful api documentation

Supported frameworks

  • Spring MVC
  • JAX-RS
  • Swagger 2.0 Annotations
  • OpenAPI 3.0 Annotations
  • JSR303 Bean Validation

Now it can export your api to markdown format.