-
Notifications
You must be signed in to change notification settings - Fork 439
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
Generating http-based client from contract #617
Comments
Hi! That's an extremely interesting issue. Actually I would change it to generation of clients as such. @jkubrynski has either mentioned this a long time ago or even filed an issue about this. So the idea would be that a snippet of concrete client side call would be generated. I think I'd prefer to generate it as a snippet rather than code, but with the pluggable architecture of this solution, one could also produce concrete code I guess. Do I understand your issue correctly? :) |
Hi Marc. Yes correct, the main point is generation of the client with pluggable architecture. I've changed the title to reflect this. Taking feign as example, I think we can easily generate the concrete code and include it in component scan. But I am not really sure how to do it with code snippet. As long as it does help the consumer to easily consume the producer both way should be ok for me :) |
Cool idea... @cah-markrave I think you might have wanted something kind of like this |
Although it’s an interesting idea, I’m not sure if that’s something that you want. |
Hmm, okay I understand your concern. And besides, now that you mentioned Swagger, basically this idea have the same concept with swagger codegen that is to generate client sdk based on api spec. I am thinking of integration between cloud-contract with swagger OAS and stumbled upon this issue #136. Referring to @marcingrzejszczak statement "it turns out that schema based solutions are not really suitable as input for Spring Cloud Contract", is there any possibility to do the opposite? (generating OAS from contract) Maintaining both contract and OAS doesn't seems a good idea.. |
Well, I would recommend you to generate your documentation using Spring REST Docs and go from there. I know there is a possibility to convert to Swagger/Open API. Will that cover your issue? EDIT: Found the issue which tracks the OAS conversion, check out spring-projects/spring-restdocs#213 |
Exactly! I think that will cover a couple of issues at the same time. WDYT? |
I agree! That's a very good idea |
Cool, that would indeed connect all the pieces together and solve the problem. So CMIIW, to summarize the solution will be: Well, I will try to look into restdocs first since I am not really quite familiar with it. Hopefully will be able to contribute something :) |
Example of doing what @henryyonathan90 suggested - https://github.com/spring-cloud-samples/spring-cloud-contract-samples/pull/29/files |
Currently many consumer still need to manually define feign client (or with any other means) to call the producer.
With the contract already defined, producer should be able to automatically generate feign client with common configuration and it can be used by all of its consumer.
So the point is:
The text was updated successfully, but these errors were encountered: