Convert Swagger JSON to RAML/YAML

后端 未结 5 1094
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 03:02

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.

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-05 03:19

    Here are the steps:

    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

提交回复
热议问题