New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No API Generation with Webflux, Swagger 3.0.0-SNAPSHOT AND spring integration #2967
Comments
I get exactly the same problem with Spring Cloud Streams (containing Spring Integration). @Numbernick thanks for the workaround. |
We also had the same issue and invented the same workaround, @Numberick, do you have any proposal how to resolve an issue? I’d implement it |
@singleton11 Thank you for your comment :) Well I would see two types which should be done:
|
@dschulten, could you please explain how this can be done correctly? |
@singleton11 @Numbernick Spring-integration initializes its http request handler beans later than the plain mvc or webflux handlers. In order to document spring-integration's handler classes, the The solution to invert the conditional annotation, so that it disables the normal bootstrapping if springfox-spring-integration is present, sounds more appropriate, but I faintly remember that was not as easy as it sounds. I'll check again, open for suggestions. |
see PR #2995 |
I'm working with Spring Webflux, Swagger 3.0.0-SNAPSHOT and google cloud integration from spring (so Spring integration). I have several REST-Endpoints which needs to be documeted via swagger. I was following the normal implementation of swagger as described in #1773 . So far so good.
I ended with an almost empty swagger-ui page with following errors:
😱 Could not render e, see the console.
The Console Output was like:
TypeError columnNumber: 189990 fileName: "http://localhost:8080/webjars/springfox-swagger-ui/swagger-ui-standalone-preset.js?v=3.0.0-SNAPSHOT" lineNumber: 13 message: "l[this.state.selectedIndex] is undefined" stack: "value@http://localhost:8080/webjars/springfox-swagger-ui/swagger-ui-standalone-preset.js?v=3.0.0-SNAPSHOT:13:189990\nw/t.prototype.render@http://localhost:8080/webjars/springfox-swagger-ui/swagger-ui-bundle.js?v=3.0.0-SNAPSHOT:70:61143[etc.]
The api-docs page just returned a 404 Not Found.
So the reason for the 404 is just an empty documentationCache in
Swagger2ControllerWebFlux
. I invested some breakpoint at startup, like in the loading class for all handler resolvers inDocumentationPluginsBootstrapper
and no single method got called to populate the documentationCache.The problem is the top annotation:
The conditional clashes with the google cloud integration setup and leeds to an empty documentation for my webflux controllers. So since there is no documentation found, the api-docs page results in an 404 Not Found error and the swagger-ui page results in an not helpful javascript implementation error.
My workarround is to create the bean at startup on ym own like (kotlin-code):
This results in a total working swagger-ui and api-gen.
My question / change request would be to have a more apporiate solution for applications working with WebMvc / WebFlux AND spring integration.
BTW: Adding
springfox-spring-integration-webflux
as library results in following Stacktrace, so this sounds not like a solution:The text was updated successfully, but these errors were encountered: