Supported API definition elements

This section describes the elements that you can include in your Swagger or RAML API definition import file.

API endpoint detailsThe following table lists the API endpoint details that you can include in your API definition import file, their corresponding Swagger and RAML properties, and a sample value for each entry.
API element Swagger property RAML property Example
API name title title Sample API
Hostname host baseUri http://myapi.example.com
Base path basePath A top-level resource. /myapi123
API key name and location securitySchemes securitySchemes
{
  "type":"apiKey",
  "name":"api_key",
  "in":"header"
}
API description description description This is a sample API.
API resource detailsThe following table lists the API resource details that you can include in your API definition import file, their corresponding Swagger and RAML properties, and a sample value for each entry. In Swagger files, resources are included in the Paths object. In RAML, they are nested under the top-level resource property.
API element Swagger property RAML property Example
Resource name A top-level property in the Paths object. A resource nested in the top-level resource. /cpcode
Resource path A top-level property in the Paths object. A resource nested in the top-level resource. /cpcode
Resource method A second-level property in the Paths object. A top-level property in a resource. post
Resource notes description description This is a sample resource.
Parameter detailsThe following table lists the parameter details that you can include in your API definition import file, their corresponding Swagger and RAML properties, and a sample value for each entry. In Swagger files, parameters are included in the Parameters object. In RAML, depending on the parameter type, they are nested either under the queryParameters or uriParameters property.
API element Swagger property RAML property Example
Parameter name name A top-level property in either queryParameters or uriParameters property object. status
Parameter location in Indicated by queryParameters or uriParameters. query
Parameter type type type integer
Required parameter required required true
Parameter data typesThe following table lists the supported parameter data types and, if applicable, their corresponding optional attributes.
Data type Optional attributes
String minLength and maxLength
Integer minimum and maximum
Number minimum and maximum
Boolean N/A
JSON/XML object N/A