Creating REST APIs by Importing existing APIs
Create an API by importing an existing API.
Procedure
- Go to the project where you want to create an API and click the
APIs tab. You are redirected to the REST APIs page, where you see a list of any existing REST APIs for that project.
- Click Create API to go to the New API page and select Import API/I have an existing API.
- Click Browse and import a swagger file and click
Next. The Basic Info page appears.
- In the Name field, provide a suitable name for the API you want to create.
- In the Type field, select the type of the file For example, select the Swagger 2.0 or OpenAPI 3.x file type.When an OpenAPI 3.x file is selected, the Document name prefix field appears. The value of Document name prefix is used while creating the JSON document types and variables for anonymous schemas.
- In the Convert to Defined Type field, select the value as true or
false. The default selection for Convert to Defined Type field is true. This field is only available when creating a REST API using the Import API/I have an existing API option and using a Swagger 2.0 file.
- If the value for Convert to Defined Type field is selected as True, it indicates that the input variables in the request body are converted to the data type defined in the signature. However, if the value is set to False, the input variables in the request body are passed as-is in the service pipeline.
- When a REST API is created using the Import API/I have an existing API option and using a OpenAPI 3.x file, the Convert to Defined Type field is not available.
- You can edit the Convert to Defined Type field value using the edit option. However, to save these changes it is important to re upload the document.
- Click Save. The API is imported and saved for your project.