3 ms·
IMO json+REST works just as well for contract first workflows. Just write up the contract in an IDL, have both sides agree on it up front, then use codegen too
by yashap 8y ago
IMO json+REST works just as well for contract first workflows. Just write up the contract in an IDL, have both sides agree on it up front, then use codegen tools to generate client SDK(s) for your client language(s) of choice. Same workflow as as with gRPC, though you’re probably less likely to get generated server stubs (which you don’t really need with json+REST anyways).
- ben_jones 8y agoCould you recommend any codegen tools that generate bindings in Typescript or Go? I suppose there's some tools around swagger and various GraphQL libraries, but I'm not seeing any great options though a quick google search.
- ThePadawan 8y agoI have made negative experience with using a custom swagger-codegen [0] template - the library is quite diffuse with no clear direction in which PRs are merged and which aren't, making it a mess to read and extend. I have however, managed to generate the exact Typescript bindings I wanted using it. In contrast, I have been using NSwag [1] to generate C# client code with far greater comfort, and it seems to support multiple Typescript clients already. [0] https://github.com/swagger-api/swagger-codegen https://github.com/swagger-api/swagger-codegen [1] https://github.com/RSuter/NSwag https://github.com/RSuter/NSwag
- Brometheus 8y agoSwitched to NSwag here, too. I'm in a Python environment and we use it to generate the TypeScript code for our services.
- wing328hk 8y agoSorry to hear your negative experience with Swagger Codegen regarding the PRs. Having been "managing" the project for a few years, I agree with you that I've not done a very good job in reviewing and merging all the PRs (239 open PRs as of today) contributed by the awesome community. Myself and 40+ top contributors have decided to fork Swagger Codegen so as to maintain a community-driven version called OpenAPI Generator [1] with a better governance structure to move the project forward. Now there are 10+ core team members and contributors with proper rights to merge PRs so I think we've better PR management in OpenAPI Generator. Please refer to the Q&A [2] for the reasons behind the fork. For TypeScript generators, we've recently added the TypeScript Axios client generator [3] and there's an ongoing project to consolidate the TypeScript generators into one [4]. Please check these out and let us know if you've any feedback. We hope you will find OpenAPI Generator useful in your projects. [1] https://openapi-generator.tech https://openapi-generator.tech [2] https://github.com/OpenAPITools/openapi-generator/blob/master/docs/qna.md https://github.com/OpenAPITools/openapi-generator/blob/maste... [3] https://twitter.com/oas_generator/status/1041939441109983232 https://twitter.com/oas_generator/status/1041939441109983232 [4] https://github.com/OpenAPITools/openapi-generator/projects/4 https://github.com/OpenAPITools/openapi-generator/projects/4
- mlevental 8y agowhich IDL do you use? which codegen tools and for which languages? also i think i'm missing something: >which you don’t really need with json+REST anyways why don't you need server stubs for json+REST?