3

Is there any springfox implementation available for swagger3 or OpenAPI 3 which support media-type versioning of the endpoint, apart from JAX-RS?

Sampada
  • 2,931
  • 7
  • 27
  • 39

1 Answers1

3

Short answer: no. See 2023 update at end.

There is a pinned issue tracking this in springfox's github: https://github.com/springfox/springfox/issues/3070 Best read that for the latest news, but at the moment the project is lagging both OpenAPI and Spring Boot, and the list of changes needed is quite long. The project owner sounds a bit overwhelmed and has asked for help from the community.

Based on that, I'd say the future of springfox is in doubt. Hopefully this will pass. But given the difficulties they are having it might be worth looking for alternatives.

One is: https://github.com/springdoc/springdoc-openapi While it certainly doesn't have the documentation, community and stockpile of answered questions that springfox has, the basic functionality works. I've only just started using it so that's all I can say at the moment. :-)

2023 Update: The answer is "no" again. Springfox 3.0 worked again for a while but doesn't seem to be supported for Spring Boot 2.5 or higher. We have now migrated to springdoc-openapi and found that it wasn't difficult to do. See: https://springdoc.org/migrating-from-springfox.html

One small gotcha is you may need to review all places you use @Parameter on a @RequestParam. If the parameter type is a class with multiple fields, you sometimes need to use @ParameterObject instead of @Parameter. That tells Springdoc to document each member of the class as a separate request parameter.

Bampfer
  • 2,120
  • 16
  • 25
  • 3
    In mid-2020 the version 3.0 of SpringFox was released and it supports Spring 5 and OpenAPI 3. We have not tried to convert an existing project to it, but the basic functionality worked fine on a new project. I can't speak to media-type support, We are hopeful that the springfox project is in a better place now, but note there have been no patches since the initial release in July. – Bampfer Oct 29 '20 at 15:58
  • I updated the answer again, since springfox 3.0 is not supported for Spring Boot 2.5 or higher. – Bampfer Feb 06 '23 at 18:06