springfox icon indicating copy to clipboard operation
springfox copied to clipboard

Spring 5 support

Open pabl0rg opened this issue 9 years ago • 132 comments

Or are there plans to support it?

pabl0rg avatar Apr 16 '17 20:04 pabl0rg

There definite is a plan to support it. It will however have to wait till Open API support is completed.

dilipkrish avatar Apr 19 '17 01:04 dilipkrish

Spring 5 was released. Do u have any progress?

oleg-savko avatar Oct 03 '17 22:10 oleg-savko

@oleg-savko Unfortunately now. Would love some help on this one. Anyone wanting to help with that.

dilipkrish avatar Oct 04 '17 09:10 dilipkrish

@dilipkrish - Would like to contribute to #1773,can you help me with getting started guide.

amitsaluja avatar Oct 05 '17 04:10 amitsaluja

@amitsaluja frankly I haven't tried it andI don't know what it will take. I suspect certain functionality is not working or is broken.

  • Start a project with spring 5
  • See what is broken
  • Come up with a solution and propose a pull request
  • If it looks good and has tests to accompany it, i'll pull it in.

Thank you for wanting to help!

dilipkrish avatar Oct 05 '17 11:10 dilipkrish

Hi @dilipkrish I looked into it and I found out that there is a lot of job to do. In webflux, there is no more package web.servlet but it changed to web.reactive which requires more changes than expected. If you want to support the older versions of Spring after release, you probably need to create new modules for webflux where new things will be done.
At the moment, there is 2 modules in the project which are dependent on springframework.web.servlet and directly use a lot of classes from it. Spring 5 has moved staff from there to org.springframework.web.reactive where also some structure and implementation of classes was changed. Maybe it will be good to figure out how new modules would be organized in the future so the project will be easily maitained. What do you suggest?

xBATx avatar Oct 05 '17 11:10 xBATx

Hi @dilipkrish, I think the WebFlux support will be a very important milestone for springfox. Follow with the finding from @xBATx , I would find there are 2 major update on springfox need your input.

  1. Dependency on "org.springframework.web.servlet.mvc" in RequestHandler.
  2. Module layout for webflex support

For (1), currently, RequestHandler depends on class NameValueExpression, PatternsRequestCondition and RequestMappingInfo is in webmvc package. They have the counter part in webflux "org.springframework.web.reactive" (see the link). Shall we consider.

  • define a interface in springfox and adapt the webmvc and webflux class, or
  • adapter the weblux model to webmvc model and not changing RequestHandler. For (2), my suggestion is to divide the model springfox-spring-web into springfox-spring-web-common, springfox-spring-webmvc, and springfox-spring-webflux for common class, webmvc and webflux support.

MinosPong avatar Oct 25 '17 04:10 MinosPong

@MinosPong thanks for your detailed analysis. I would agree with your findings. I really don't have the bandwidth to work on this right now and could use some help.

dilipkrish avatar Oct 26 '17 11:10 dilipkrish

swagger+netty server+webflux with kotlin is so cool.

JackFish avatar Nov 09 '17 09:11 JackFish

@JackFish baby steps :)

dilipkrish avatar Nov 13 '17 14:11 dilipkrish

Hello, I need this feature on my project. I have rewrite some code of springfox to work exclusively with spring-webflux, this take 4 hours to do. This work fine, there are two many dependency to broke :

  • spring webmvc
  • servlet-api

Now, I will try to rewrite my code to work with springmvc and spring-webflux in parallel. My big issue is that springfox-core depend of spring-webmvc, I think broke this dependency can broke some dependent projects.

Has someone already start a fork of springfox to work on that?

deblockt avatar Jan 17 '18 09:01 deblockt

I have a verry first working swagger lib on this fork : https://github.com/deblockt/springfox

Is there anyone to work with me on this?

deblockt avatar Jan 24 '18 14:01 deblockt

Hi, I checked out your project and managed to adopt it in one of my projects, currently migrated to spring-boot-2.0.0.M7.

Few things I noticed right away though,

  1. I used to have redirect to swagger-ui.html from /, now it says that this redirect cannot be resolved to view, which probably means its not registered since webflux isnt using webmvc.
  2. The Docket is always sending the requests to localhost:8080 even though the app is working on different port, so I will check this out. Managed to define .host() in my Docket to overcome this for now.
  3. I have custom Securities set for different Dockets and even though I authenticate succesfully in swagger the Headers are not being sent, but I think that this is problem of Swagger 2.8 not this project explicitly. (to note I was previously using 2.7, never migrated to 2.8)

goodlifeinc avatar Jan 26 '18 15:01 goodlifeinc

@deblockt that is really cool!! Would love to help and answer any questions you might have. Let me know if you'd like access to this repo work on it.

dilipkrish avatar Jan 30 '18 04:01 dilipkrish

@deblockt nice work! Your changes are working very well with webflux. I hope that it will be in a released version soon.

anagypitech avatar Feb 06 '18 12:02 anagypitech

@deblockt Would you like to send a PR to pull your changes in.

dilipkrish avatar Feb 06 '18 12:02 dilipkrish

Hi all, I also need springfox that is compatible with Spring 5 and Spring Data Kay. I've managed to get it working and passing the tests at https://github.com/iles-2e/springfox.

Now I haven't tried to support the new features in the Spring 5 as @deblockt , this is just updating dependencies and fixing broken API changes. In order to build the whole thing, I also needed to update Spring Boot, so this one uses recently released spring-boot:2.0.0.RC2.

I've read somewhere you're trying to support java 1.6+? With Spring 5 and all, the minimum is 1.8 so perhaps this is a good way to start springfox 3.x? We could remove Guava then as well...

iles-2e avatar Feb 23 '18 15:02 iles-2e

@iles-2e thank you! I could use all the help. At the moment trying to get 2.8.1 out with some bug fixes. And 2.9.0 will be the last release with support for 1.6 with some improvements in model generation => #2056 and hopefully get to pull in @deblockt 's PR as well. The plan is to move to 3.x :) ... and java 8 \o/

dilipkrish avatar Feb 25 '18 16:02 dilipkrish

Hey. Is there any timeline for version 2.9.0 with @deblockt 's PR?

jarekCC avatar Mar 07 '18 15:03 jarekCC

@deblockt i tried your code and /v2/api-docs endpoint is giving the swagger json. but /swagger-ui.html is not working, have we changed the swagger-ui endpoint?

Naitik333 avatar Mar 08 '18 10:03 Naitik333