Java - Spring WebClient Code Generator
Is your feature request related to a problem? Please describe.
The Spring Framework is a popular application framework. While RestTemplate is usually used for RESTful communication, the library is now deprecated as per the Spring Framework 5.0 Documentation
WebClient is the future-ready solution to RESTful Communication in Java Spring
Describe the solution you'd like I would like to contribute by adding a CodeGenerator for the Java Spring WebClient configuration. This will help new Spring Developers to instantly generate snippets as well as developers who are migrating from RestTemplate to WebClient to make the process smooth.
Additional context I would like to have some input from @umeshp7, @shreys7 or any of the other maintainers on how to name this in terms of language variant. Since clearly, the language is Java but the variant is WebClient and not Spring. Could we do something like what we did with JavaScript and NodeJs?
Open to inputs. Thanks!
I need some input on how we might configure tests for such a generator. Unlike Java-codegens, this snippet would not compile unless in an Spring Boot Project. Would appreciate some advice from @umeshp7 or @shreys7 on how to go about this
i think you can orient yourself very closely on the okhttp tests which also require the httpok library which is stored in the dependencies.zip including the spring jars the same way should work
@ajwad-shaikh I resonate with your idea here. I am also looking for some code-gen tool for requests in Postman which are suited for spring-boot. You mentioned WebClient by Spring, I checked the documentation, It mentions that WebClient needs a HttpClient which they already have, can we also try to include a flavor for openfeign-client doc for open-feign in this code-gen? I will gladly take up the development part for open-feign.
Im confused by the assertion that webclient just uses httpclient: in postman for example I have a form in the request body and in postman this is clear: I'd like to see a way to automate that: it should automatically create the multi map and adds the key/value pairs...or am I missing something?
Hey @Louisa-Bieler , I am sorry for the confusion, I wanted a separate support for another language + framework. I think what you are mentioning is a special use-case. Although I must say, I have not come across a use case like that, so can't help on this, maybe an example of the use case will help for clarity.
I would add to my comment for clarification. So, I am looking for support for spring-boot codegen in postman. I am thinking of using openfeign variant for doing requests rather than some default httpclient that comes built-in with java-spring boot. And I will do the development for the same. It will help me a lot.
Hey @VShingala @akshaydeo , Is there any minimum criteria for a PR to be merged for a new codegen feature?
@hp77-creator You can find out how to contribute here. Minimum criteria would be to have good written logic and mentioned tests in the shared page.
From what I see, both WebClient and OpenFeign has good adoption so it would be great value addition.
Thanks @VShingala , this is helpful.