Skip to main content

API Transformer Overview

You can convert API definition/specification files into any format of your choice from amongst more than 10 supported formats including OpenAPI (previously known as Swagger), RAML and API Blueprint (complete list available in the later sections). This allows you to fully utilize all tools and functions that come with each format and saves the extra cost of having to rewrite your API definitions all over again.

How Does Transformer Work?

The API specification document you input goes through the following steps internally while you're only performing a one step - transformation:

  1. The API specification is imported.
  2. The imported API definition is validated.
  3. If the API passes validation, the API is converted/exported to desired format.
note

When an API definition passes through the import phase during transformation it is not added to the Dashboard as is the case when explicitly importing an API.

Configure Transformer

You can fine-tune and customize the transformation process according to your needs. This includes the ability to configure both import and export stages of the transformation and much more. Please visit our related documentation on this topic here.

Supported Formats in API Transformer

Refer to the lists below for detail on which versions and formats are supported for input and output of the Transformer:

Supported Input Formats

The API Transformer supports the following API specification formats as input and converts them into the selected output format:

API Specification FormatVersionFile Format
OpenAPI/Swagger3.1
3.0
2.0
1.x
JSON/YAML
JSON/YAML
JSON/YAML
JSON
RAML1.0
0.8
YAML
YAML
Postman Collection2.0
1.0
JSON
JSON
Insomnia3JSON/YAML
HAR1.2JSON
API Blueprint1AMarkdown
WADL - W3C2009XML
WSDL - W3C1.1XML
Google Discovery-JSON
I/O Docs - Mashery-JSON
APIMATIC-JSON

Transforming an API Specification With Multiple Files

If your API specification document is split up into multiple files for reusability purposes or any other reasons, we recommend that you create a ZIP file and add all relevant files to it. Then, upload this ZIP file when transforming. Ensure that all referenced files are part of the ZIP file and all relative paths to the files within the ZIP file are valid, to avoid any issues during the transformation e.g. if you are uploading a RAML ZIP file, ensure that all files referenced using !include or $ref are all present in the uploaded ZIP file.

It is recommended that in a ZIP file, the main API specification file is present in the root directory. If that is not the case, Transformer will iterate the ZIP file contents and pick the first file that validates as a main file in one of the supported input formats.

Transforming Multiple API Specifications

If you wish to transform multiple API specifications to generate a single API specification in any format, then you need to enable merging in the root directory, ZIP all files and then transform the ZIP file. It is very important to correctly structure the API specification documents when merging, to get desired results.

When merging multiple API definitions for purpose of transforming the output, we recommend that you turn off strict validation meant specifically for Code Generation use-cases. This can be done by enabling the merge setting SkipCodeGenValidation.

Supported Output Formats

The API Transformer supports conversion of the provided input API specification into the following formats:

API Specification FormatVersionFile Format
OpenAPI/Swagger3.1
3.0
2.0
1.2
JSON/YAML
JSON/YAML
JSON/YAML
JSON
RAML1.0
0.8
YAML
YAML
Postman Collection2.0
1.0
JSON
JSON
Insomnia3JSON/YAML
API Blueprint1AMarkdown
WSDL - W3C1.1XML
WADL - W3C2009XML
GraphQL Schema-GraphQL
APIMATIC-JSON