Convert Swagger JSON to RAML / YAML

How to convert Swagger JSON to RAML / YAML and test it? I am not looking for a software path, just one conversion.

+7
json api yaml swagger raml
source share
5 answers

Here are the steps:

  • Export Swagger JSON to a file on your disk. This JSON must be published on your server in the following URI: / swagger / docs / v1
  • Go to http://editor.swagger.io/#/
  • In the upper left corner, select File-> Import File ... Point to the local Swagger JSON file that you exported in step # 1 to open in Swagger
  • Choose Create Client β†’ Swagger YAML Settings from the menu
  • It will generate YAML, which you can check on the http://www.yamllint.com/ website
+8
source share

Conversion

If you want to convert from any version of Swagger to RAML 0.8, then APITransformer.com can do it for you. We are almost done exporting RAML 1.0. Release it in a week.

Check

The converted description comes from the same code engine that APIMatic uses to validate the API description before creating the SDK / Client libraries. Therefore, the converted RAML will be checked by default.

The description of the API in various formats can also be verified using the APIMatic CLI or the APIMatic API

+3
source share

While I want the command line tool to appear, this company made a converter:

https://apitransformer.com/

+1
source share

To convert an API specification between different formats (e.g. Swagger / OpenAPI, RAML, Postman, etc.), you can use the following free open source tools:

+1
source share

Actually quite simple

The web version of the swagger editor provides the flexibility to import an existing swagger file (JSON / YAML) and load the configuration file, which is currently shown. So just connect the two.

Note. JSON to YAML conversion exists, but not JSON to RAML

  • First import your JAON Swagger into http://editor.swagger.io/#/ (File> Import File)
  • Once you see your configurations, just download the appropriate version of YAML (File> Download YAML) .

The YAML version of the JSON you downloaded will be downloaded.

0
source share

All Articles