RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.69k stars 1.24k forks source link

C++ Client #3036

Open michsco opened 4 years ago

michsco commented 4 years ago

Have you ever considered extending this project to also generate C++ contracts and client? We use NSwag for both C# and TypeScript and it works extremely well. I realize that C++ is a much harder problem, but it seems like it can be done with some of the dotliquid templates.

michsco commented 4 years ago

@RicoSuter — my team is open to contributing towards this.

jeremyVignelles commented 4 years ago

Please see a similar reply here : https://github.com/RicoSuter/NSwag/issues/2962#issuecomment-660684485

Creating is a thing, but maintaining takes way more time.

I've not touched C++ for a long time, but what's the story for http requests / json handling in C++? Is there any "standard" library for doing these things or would there be 100 flavors of C++ clients/contracts ?

michsco commented 4 years ago

Obviously C++ doesn't have a standard library for those things like C# or TypeScript, but I think there's a way to make it work if consumers are required to implement two *.dotliquid templates to do the actual serialization and HTTP request send/receive. All of the pieces of interpreting swagger, expected response codes, etc., can all be a standard set of code.

rogeryoung38 commented 3 years ago

FYI. OpenAPI Generator comes with a C++ (cpprestsdk) client generator. My teammates are using it and the overall experience is not bad so far.

Also welcome another generator in NSWag to support C++.