In SoapUI Open Source, you can import REST service to your project by using Swagger/OpenAPI definition. Or, you can export REST API definition to a Swagger/OpenAPI format.
Requirements
-
SoapUI Open Source 5.7.0 supports Swagger/OpenAPI definitions, as well as integration with SwaggerHub SaaS out-of-the-box. You do not need to install any plugins.
Supported Swagger/OpenAPI versions: 2.0
-
To work with Swagger/OpenAPI definitions in SoapUI Open Source prior to 5.7.0 you must have the related plugin. Additionaly, to work with SwaggerHub you must have one more plugin. These plugins are bundled with the product, so you do not need to install them manually.
Supported Swagger/OpenAPI versions: 1.x, 2.0
Import from a file
To import REST API by using Swagger/OpenAPI definition, do the following:
-
Right-click the project node in the Navigator tree and select Import Swagger/OpenAPI definition.
-
In the subsequent dialog, select the definition file you want to import.
-
The Default Media Type option specifies the media type SoapUI will use for the requests in which no media type is specified.
Import From SwaggerHub
-
Right-click the project node in the Navigator tree and select Import From SwaggerHub.
-
Search for the needed definition.
-
Select the needed definition and click OK to import API.
Tip: You can select the version of the importing API.
Export to a file
-
Right-click the project node in the Navigator tree and select Export Swagger/OpenAPI definition.
-
In the subsequent dialog, configure the export parameters:
APIs |
APIs you want to export. |
Target File |
Path to the export file. |
API Version |
Version of the exported API. |
Base Path |
Specifies the base path of the exported API. |
Swagger Version |
Version of the Swagger/OpenAPI format.
SoapUI Open Source supports only Swagger 2.0. |
Format |
Specifies the format of the exported file: json or yaml. |
-
Click OK to export the file.
Publish to SwaggerHub
-
Right-click the API you want to publish in the Navigator tree and select Publish to SwaggerHub.
-
Configure the export parameters:
API Key |
Your personal API key for accessing SwaggerHub. See more at SwaggerHub documentation. |
Owner |
The name of the API owner (a user or an organization). |
Unique API name |
The name of the API. The name must be 3 to 60 characters long, must start and end with a letter or digit, and can have the A..Z a..z 0..9 - _ . characters. |
Version |
The API version. For example: 1.0, 1.0.0, 1.0b5, beta. |
Remember credentials |
Select if you want to save the entered credentials for future exports. |
Private |
Select if you want to make the API private. |