问题
I've a requirement to create a HTTP API layer over a legacy API interface written in C++. My plan is to generate the Swagger or open API file and then make it available to bunch of projects that needs to write a client (who will be consumer of new API) or a server (wrapper to legacy API).
Is there anything that can expedite this requirement (other than manually parsing them and creating swagger spec file)? i.e. using C++ code to generate swagger JSON/YML file
回答1:
Quite late answer and I think that with no good news.
If you're talking about the implementation of Annotations in C++. As far as I know the Swagger Core Annotations are part of the Swagger Core Project, and in the documentation you can find:
Swagger Core is a Java implementation of the OpenAPI Specification. Current version supports JAX-RS2.
Also the Prerequisites says:
You need the following installed and available in your
$PATH
:
- Java 8
- Apache maven 3.0.4 or greater
- Jackson 2.4.5 or greater
回答2:
you've been tried Swagger Codegen is an API that serves for a bunch of languages inclusive C++
来源:https://stackoverflow.com/questions/53699268/is-there-a-way-to-generate-a-swagger-specification-file-from-c-code