Is there a way to generate a swagger specification file from C++ code?

我是研究僧i 提交于 2020-01-03 08:58:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!