Skip to content
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

Feature/spring integration support #2793

Merged

Conversation

dschulten
Copy link
Contributor

@dschulten dschulten commented Nov 21, 2018

What's this PR do/fix?

Adds support for spring-integration-webmvc and spring-integration-webflux

Are there unit tests? If not how should this be manually tested?

There are unit tests, manual tests are possible with the related PR springfox/springfox-demos#57

Any background context you want to provide?

Some changes to the existing code were necessary.
In Spring-Integration, the IntegrationRequestMappingHandlerMapping and WebFluxIntegrationRequestMappingHandlerMapping are initalized later than other HandlerMappings. Therefore I changed DocumentationPluginBootstrapper so that it disables itself in favor of SpringIntegrationDocumentationPluginBootstrapper which fires on ContextRefreshedEvent, and let both derive from a common base class for the actual bootstrapping work. Also, the existing WebMvc and WebFlux RequestHandlerProvider implementations needed to be told to leave the spring-integration handler mappings alone.
The spring-restdocs support is realized by a standard plugin, the SpringRestDocsOperationBuilderPlugin.

What are the relevant issues?

#550
#2754 closed in favor of this PR.
#797

…flux instead, first working version of webflux integration
…e supported in OpenApi 3, but not in OpenApi 2
@codecov
Copy link

codecov bot commented Nov 23, 2018

Codecov Report

Merging #2793 into master will decrease coverage by 0.35%.
The diff coverage is 85.08%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2793      +/-   ##
============================================
- Coverage     94.78%   94.42%   -0.36%     
- Complexity     3161     3219      +58     
============================================
  Files           354      364      +10     
  Lines          8067     8300     +233     
  Branches        608      616       +8     
============================================
+ Hits           7646     7837     +191     
- Misses          271      305      +34     
- Partials        150      158       +8
Impacted Files Coverage Δ Complexity Δ
...ngIntegrationDocumentationPluginsBootstrapper.java 0% <0%> (ø) 0 <0> (?)
...umentation/spring/web/SpringfoxTemplateFormat.java 0% <0%> (ø) 0 <0> (?)
...SpringIntegrationWebMvcRequestHandlerProvider.java 100% <100%> (ø) 5 <5> (?)
...pringIntegrationWebFluxRequestHandlerProvider.java 100% <100%> (ø) 5 <5> (?)
...ng/web/SpringIntegrationWebFluxRequestHandler.java 100% <100%> (ø) 6 <6> (?)
...ing/web/SpringIntegrationWebMvcRequestHandler.java 100% <100%> (ø) 6 <6> (?)
...ringIntegrationNotPresentInClassPathCondition.java 44.44% <44.44%> (ø) 3 <3> (?)
...ing/web/plugins/WebFluxRequestHandlerProvider.java 94.44% <75%> (-5.56%) 6 <1> (+1)
.../plugins/SpringRestDocsOperationBuilderPlugin.java 83.07% <83.07%> (ø) 16 <16> (?)
.../web/plugins/DocumentationPluginsBootstrapper.java 91.3% <90.9%> (-4.85%) 10 <10> (-8)
... and 13 more

@dilipkrish dilipkrish added the PR label Nov 29, 2018
@dilipkrish dilipkrish added this to the 3.0 milestone Nov 29, 2018
@dilipkrish dilipkrish merged commit 9c1434e into springfox:master Nov 29, 2018
@dilipkrish
Copy link
Member

Thank you @dschulten, much appreciated 🙇. I did some re-formatting, to match current coding style, apologies for not sharing that publicly. At a high level

  • 2 space indents (that was the preference @adrianbk and I agreed on)
  • splatting all static imports
  • splatting regular imports only if it exceeds 100 classes from that package (a way to make it explicit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants