You can set up a Swagger document in an IBM® API Developer Portal instance as a synchronization
source in an IBM DevOps Test Integrations and APIs (Test Integrations and APIs) project.
Before synchronizing with a Swagger document in an API Developer
Portal instance, you must first create a physical Test Integrations and APIs
connection to that API Developer Portal instance.
-
Open the Logical View of the Architecture School perspective
of Test Integrations and APIs.
-
Open the toolbar of Logical View, click Web
> Swagger Definition. The Synchronization Source window
in the Create a new Synchronization Source wizard is displayed. Look
for Swagger Definition in the Type list.
-
Click Registry next to the Location field.
The Browse a Service Registry window is displayed.
-
Verify that the Service Registry URL list
displays the IBM API Developer
Portal instance that you want to use.
-
Optionally, you can perform any of the following tasks:
- In the Name field, enter the full or partial
name of the Swagger document that you want to import. You can use
an asterisk (*) as a wildcard.
- Select the Exact name match check box if
you want to search Swagger documents in the selected API Developer
Portal instance only by exact names.
- Select the Case Sensitive check box if
you want your search of Swagger documents in the selected API Developer
Portal instance to be case-sensitive.
-
Click Find REST APIs to search for
the Swagger document that you want to import. Depending on the search
parameters that you selected, search results are displayed in the Browse
a Service Registry window.
-
Double-click the relevant API service. The Swagger documents
associated with the selected API service are displayed.
-
Select the Swagger document that you want to import.
-
Click OK to close the Browse
a Service Registry window. The selected Swagger document
is displayed in the Configuration area on the Synchronization
Source window in the Create a new Synchronization Source
window.
-
Click Next. The Generate
Assets for Operation window in the Create a new Synchronization
Source wizard is displayed.
-
To generate tests and virtual services for the operation,
click Create Tests and Create Stubs.
You can modify the name of the asset or continue to use the default
name.
-
Click Next. The Create
Test for Operation window of the Create a new Synchronization
Source wizard is displayed.
-
For each test you requested, provide the following information:
Note: The number of tests to be created is shown in the Test creation
progress bar at the bottom of the window.
-
Select a source option for the Input message:
- Generate message from Schema
- Use the schema information from the source document to generate the Input message.
- Specify a message
- Create your own message. You can enter the message in the text box that is provided, paste it
from your copy/paste buffer, or browse to a file that contains the message. The message can be in
XML, JSON, or any other supported message format.
-
Select Include optional schema fields to complete the message with
optional fields from the schema that is provided by the source document.
-
Select a source option for the Output message.
The options that are available are the same as the ones for the Input message, with the
exception that you can opt to not generate an Output message.
-
Click Next and repeat this step for each of the generated tests.
When you have specified sources for all selected tests, a Summary
page is displayed with the number of synchronization items, tests and stubs that were created.
Starting from Test Integrations and APIs Version 10.0.0, the
Summary page displays all information, warning, and error messages that
occurred during synchronization.
-
Click Finish. The Test Factory perspective is displayed.
imports the selected Swagger document and adds it as a synchronization source to the
logical model of your project.