Creating a Consumer REST API Descriptor from a Swagger Document
You can create a consumer REST API descriptor (RAD) from:
External Swagger document accessible through a URL
A REST API on
API PortalA REST resource/service residing in CentraSite
Keep the following in mind when creating a consumer RAD from a Swagger document:
The Swagger document that you use to create a consumer RAD must be based on the Swagger Specification version 2.0.
To create a consumer RAD from a REST resource/service in CentraSite or from a REST API on
API Portal, configure
Designer to connect to CentraSite or
API Portal.
Ensure that you use a valid Swagger document before creating a consumer RAD.
Following are the supported components from the Swagger Specification version 2.0:
MIME types:
application/xml,
text/xml,
application/jsonProtocol:
http,
httpsAuthentication mechanism:
basic To create a consumer REST API descriptor from a Swagger document
1. In the Service Development perspective of Designer, select File > New > REST API Descriptor.
2. In the Create a New REST API Descriptor dialog box, select the folder in which you want to save the RAD.
3. In the Element name name field, type a name for the RAD using any combination of letters, numbers, and the underscore character. For more information about restricted characters, see Guidelines for Naming Elements. 4. Click Next.
5. In the Select the Source Type dialog box, select Consumer and click Next.
6. In the Select the Swagger Document Location dialog box, select one of the following to perform the corresponding action in Designer:
Source Location | Purpose | Course of Action |
API Portal | Generate a RAD from APIs present in the API Portal. | Click Next and then in Select the API from API Portal list, select the API that you want to use to create the RAD. |
CentraSite | Generate a RAD from a REST resource/service available in CentraSite. | Click Next and then in Select REST Resource from CentraSite, select the REST resource in CentraSite that you want to use to create the RAD. |
File/URL | Generate a RAD from a Swagger document that resides on the file system or on the Internet. | Do one of the following: Enter the URL for the Swagger document. The URL should begin with http:// or https://. Provide your username and password to use the Swagger document from the website. Click Browse to navigate to and select a Swagger document on your local file system. |
7. Click Finish.
Designer creates the consumer RAD. It also creates the associated REST connector services (under
connectors folder) and document types (under
docTypes folder) and places the
connectors and
docTypes folders under a folder that has the same name as the RAD appended with an underscore (_). The
Properties view displays the source URL and source URI value for the RAD and its associated document type. For more information about the fields in the
Properties view, see
REST API Descriptor Properties.
Notes:
The RAD that you have created is uneditable and ensure that you do not edit, rename, or delete the
docTypes and
connectors folders, its subfolders, or the parent folder containing them all. Also, when you move the RAD to a different location in
Designer, ensure that you move the corresponding folder containing the
connectors and
docTypes folders..