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

Support Spring Webflux #51

Open
Lazalatin opened this issue Apr 19, 2020 · 3 comments
Open

Support Spring Webflux #51

Lazalatin opened this issue Apr 19, 2020 · 3 comments
Labels
Feature Request Feature request.

Comments

@Lazalatin
Copy link

Lazalatin commented Apr 19, 2020

Is your feature request related to one or multiple existing converters?
Spring(Webflux?)Converter

Describe the solution you'd like
I'd like to see Spring Webflux among the supported converters. Webflux is based on the Spring Reactive concept, which is merely used for non-blocking implementations of RESTful services.
For a user it should be as easy to test his API against an openAPI spec for Spring Webflux as it is for Spring MVC.

Additional context
See here for Spring Reactive: https://spring.io/reactive

Personal Comment
I'd like to try to implement this feature myself, so I would be glad for any advice given 👍

@Lazalatin Lazalatin added the Feature Request Feature request. label Apr 19, 2020
@cc-jhr
Copy link
Collaborator

cc-jhr commented Apr 21, 2020

Hi @Lazalatin,

that sounds interesting. It's really cool that you offer to do the implementation.

Since webflux has it's own artifact ("spring-webflux") I would agree with what you implied by Spring(Webflux?)Converter. I think that it should get a separate module.

For spring-webmvc I grabbed the bean which contains all the endpoints (RequestMappingHandlerMapping) and started converting the data.
I'm not sure whether webflux offers a similar bean. If not then this might be very difficult.

If you start a new module, grab the hikaku-core as dependency. Create a class, e.g. SpringWebfluxConverter which implements AbstractEndpointConverter.
In override val supportedFeatures you list all the features that the converter supports.
For spring-webmvc I experimented a lot with different ways to declare a rest endpoint and default values in a hello-world project. For each case I created a test.
I hope that this is helpful to you.

If you have any questions, don't hesitate to ask.

@Lazalatin
Copy link
Author

Hi @cc-jhr,

thanks for your kind reply!

I managed to fiddle around with the code from the original SpringConverter and investigated more into the differencing and shared concepts between Spring MVC and Spring Reactive. Delving further into development and restarting from scratch a question came to my mind, stumbling over this particular graphic:

Spring MVC vs. Reactive Venn Diagram

As we can see, there are overlapping concepts in defining REST-Endpoints for Spring MVC and Reactive. While one could use @(Rest)Controller to define endpoints, Spring Reactive also knows concepts of RouterFunktions and HandlerFunctions providing a functional approach to handle requests to a certain service.

As I am more familiar with the controller-based approach I would like to have this implemented first. Maybe I would also cover the more functional aspects later, if I get a chance to learn them 😁

If you have any thoughts on that, I'd like to hear them 👍

@cc-jhr
Copy link
Collaborator

cc-jhr commented Apr 24, 2020

Hi @Lazalatin,

thank you for the update. That sounds plausible to me. Start small and with what you are more familiar with. Remember that you can track the supported cases in README.md.

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

No branches or pull requests

2 participants