Convert Swagger JSON to RAML/YAML

helios picture helios · Sep 23, 2015 · Viewed 36.5k times · Source

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.

Answer

helios picture helios · Sep 23, 2015

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