将 Swagger JSON 转换为 RAML/YAML [英] Convert Swagger JSON to RAML/YAML

查看:125
本文介绍了将 Swagger JSON 转换为 RAML/YAML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 Swagger JSON 转换为 RAML/YAML 并对其进行验证?我不是在寻找一种程序化的方式,只是一次转换.

How do I convert Swagger JSON to RAML/YAML and validate it? I am not looking for a programmatic way, just a one off conversion.

推荐答案

步骤如下:

  1. 将 Swagger JSON 导出到驱动器上的文件中.此 JSON 应发布到您服务器上的以下 URI:/swagger/docs/v1
  2. 转到http://editor.swagger.io/#/
  3. 在左上角,选择 File-> Import File... 指向您在步骤 1 中导出的本地 Swagger JSON 文件以在 Swagger Editor 中打开
  4. 从菜单中选择 Generate Client -> Swagger YAML 选项
  5. 它将生成您可以在 http://www.yamllint.com/ 站点验证的 YAML
  1. Export Swagger JSON into a file on your drive. This JSON should be published on your server at the following URI: /swagger/docs/v1
  2. Go to http://editor.swagger.io/#/
  3. On the top left corner, select File-> Import File... Point to the local Swagger JSON file you exported in step #1 to open in the Swagger Editor
  4. Select Generate Client -> Swagger YAML option from the menu
  5. It will generate the YAML that you can validate at http://www.yamllint.com/ site

这篇关于将 Swagger JSON 转换为 RAML/YAML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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