Closed arschles closed 7 years ago
I expect we'll have support shortly...
@fehguy thanks. can you point me to some in-progress code?
@fehguy @arschles Any ETA or updates on the C++ generator? My team is looking for exactly this feature.
One flavor should release next weds and should be easily adaptable. What flavor are you working with? What JSON libs, etc?
We are just in the process of selecting appropriate http and JSON libraries (which was surprisingly non obvious). We've made no firm decision yet, and we'd likely go with whatever swagger-codegen supports. Our REST back end is implemented in ServiceStack, and its JSON serializer is very configurable.
I work with @schmidt4brains . boost::property_tree
looks pretty good for JSON, but I think JsonCpp
would also be OK. boost::network::http
looks like it might be the best option for networking, which means boost::future
and friends for concurrency.
OK, I'm pretty sure you can port what we've done to use those.
Hi, the C++ templates are now available here:
https://github.com/swagger-api/swagger-codegen/tree/develop_2.0/src/main/resources/tizen
They were generously sponsored by Samsung and should be a good basis for any C++ implementation.
Hi, the link https://github.com/swagger-api/swagger-codegen/tree/develop_2.0/src/main/resources/tizen does not seem to work (404).
On Thu, Apr 9, 2015 at 2:31 PM, J-cztery notifications@github.com wrote:
Hi, the link https://github.com/swagger-api/swagger-codegen/tree/develop_2.0/src/main/resources/tizen does not seem to work (404).
— Reply to this email directly or view it on GitHub https://github.com/swagger-api/swagger-codegen/issues/283#issuecomment-91126986 .
@fehguy - are we going to have a specific C++ implementation or stick with the Tizen one?
@webron after spending time on this, I'm guessing we'll have many different c++ generators based on the frameworks, etc.
If anyone on this thread wants to jump in and donate a template, that would be great.
Should be relatively easy now, for those who know C/C++ - https://github.com/swagger-api/swagger-codegen#making-your-own-codegen-modules.
I have started to implement a C++ generator for Casablanca/cpprest. It is still in its early stages, meaning there are lots of implementation and verification left. But for the not so faint of heart who wants to test things out, it does creates something that is usable...in labs...check the readme for this fork. https://github.com/MathiasWasAlreadyTaken/swagger-codegen/tree/development
@MathiasWasAlreadyTaken thanks for the contribution. Would you have time to submit a PR for the Casablanca/cpprest C++ generator? Let me know if you need any help.
Hi @wing328! As soon as I have something that have been tested and I know works I will create a pull request. Right now I know that it lack lots of functionality that should not go into the main repo.
/Mathias
@MathiasWasAlreadyTaken OK. Please take your time and let us know if you need any assistance.
+1 for cpprest generator. C/C++ strongly needs wider REST base and swagger is the best way
Another +1 for the cpprest sdk generator. PLEASE!!!!
@MathiasWasAlreadyTaken if you've something ready for beta (a partially working C++ client), I would suggest you to submit a PR so that the community can start looking into it and file PRs for improvement.
I would love to be able to work more on this, and the future is looking brighter. I might be able to do some work with it soon, so as soon as I have something that is runnable I'll submit a PR.
Do you have any more work done on it at all? You might get some assistance from others like myself :)
@MathiasWasAlreadyTaken thanks for the update. Please take your time.
(My suggestion is that even though you've partially-finished c++ generator that's not runnable yet, it's still good to submit a PR to let the community helps improve it to make it runnable)
@schmidt4brains you asked above (a long time ago) if I have any updates or have made any progress. Just FYI that I don't and am not currently planning on working on the C++ generator anymore
@arschles Thanks for the update. My team has taken an alternative approach to C++ code generation (they are basically hand-coding a wrapper layer for each REST endpoint they consume). It still feels like boilerplate work to me, but they are happy with it.
I'd be happy to tackle the templates, providing a good example client + build instructions were provided.
Here is another update related to C++ generator:
https://github.com/swagger-api/swagger-codegen/issues/2704#issuecomment-225537925
We have C++ for QT + CPPRest so time to close this.
Am I wrong or there is no server version for this two ? (qt5cpp-server, cpprest-server ?)
@itschrono there are C++ server generators for Pistache and Restbed. Would that meet your requirement?
I guess it will for my C++ (Qt5 standalone software). Now I may need a visual basic client (I known it's lame xD) see #6831
Forgive me for posting to a closed issue. The page https://github.com/swagger-api/swagger-codegen says "C++ is supported" as an API client. I consulted https://support.smartbear.com/swaggerhub/docs/apis/generating-code/index.html#generators where I see language names cpprest
, qt5cpp
and tizen
. I downloaded swagger-codegen-cli.jar version 3.0.34 and ran it with argument generate -l cpprest
(and the others) without luck. I see that https://editor.swagger.io/ has a Generate Client option cpprest
but the standalone jar apparently does not. Is there an additional jar to download? Please guide me here. Thanks in advance.
% java -jar swagger-codegen-cli.jar version
3.0.34
% java -jar swagger-codegen-cli.jar generate -i openapi.yml -l c++ -o client
Exception in thread "main" java.lang.RuntimeException: Can't load config class with name c++ Available: dart
aspnetcore
csharp
csharp-dotnet2
go
go-server
dynamic-html
html
html2
java
jaxrs-cxf-client
jaxrs-cxf
inflector
jaxrs-cxf-cdi
jaxrs-spec
jaxrs-jersey
jaxrs-di
jaxrs-resteasy-eap
jaxrs-resteasy
micronaut
spring
nodejs-server
openapi
openapi-yaml
kotlin-client
kotlin-server
php
python
python-flask
r
ruby
scala
scala-akka-http-server
swift3
swift4
swift5
typescript-angular
typescript-axios
typescript-fetch
javascript
at io.swagger.codegen.v3.CodegenConfigLoader.forName(CodegenConfigLoader.java:31)
at io.swagger.codegen.v3.cli.SwaggerCodegen.main(SwaggerCodegen.java:96)
Caused by: java.lang.ClassNotFoundException: c++
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at io.swagger.codegen.v3.CodegenConfigLoader.forName(CodegenConfigLoader.java:29)
... 1 more
Can anyone re-open the ticket? Because we have exactly the same problem as @chrisinmtown
Does anyone know if there are plans to add support in this repo? Otherwise, is there a C/C++ generator elsewhere?