有没有一种方法可以从C ++代码生成标准规范文件? [英] Is there a way to generate a swagger specification file from C++ code?

查看:94
本文介绍了有没有一种方法可以从C ++代码生成标准规范文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在用C ++编写的旧版API接口上创建HTTP API层.我的计划是生成Swagger或打开的API文件,然后将其提供给需要编写客户端(将成为新API的使用者)或服务器(旧API的包装器)的一堆项目.

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).

是否有任何东西可以加快这一要求(除了手动解析它们并创建摇摇欲坠的规范文件之外)? 即使用C ++代码生成庞大的JSON/YML文件

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

推荐答案

答案很晚,我认为这没有什么好消息.

Quite late answer and I think that with no good news.

如果您正在谈论使用C ++进行注释的实现.据我所知, Swagger核心注释 Swagger核心项目的一部分,在文档中可以找到:

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 是OpenAPI规范的Java实现. 当前版本支持JAX-RS2.

Swagger Core is a Java implementation of the OpenAPI Specification. Current version supports JAX-RS2.

先决条件表示:

您需要在$PATH中安装以下组件并可用:

You need the following installed and available in your $PATH:

  • Java 8
  • Apache maven 3.0.4或更高版本
  • 杰克逊2.4.5或更高版本
  • Java 8
  • Apache maven 3.0.4 or greater
  • Jackson 2.4.5 or greater

这篇关于有没有一种方法可以从C ++代码生成标准规范文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆