You can quickly create a virtual service (or virtual API) from an API definition in one of the formats listed below, or from an API added to your project:
- OpenAPI 3.0.0 file
- Swagger 2.0 or 1.x file
- WADL file
- WSDL file
- Any web service existing in your project
You do this with the New Virtual API wizard or with the New Virtual Service dialog, see below.
Note that some specification formats support setting example values for response data. If your spec contains such examples, ReadyAPI will use them for generated virtual responses.
Using the wizard
-
From the main menu, select File New > Virtual API:
– or –
On the Dashboard, click Virtual API in the New Test tile:
-
In the New Virtual API wizard, select API Definition:
Note: With the wizard, you cannot create a virtual service for an API in your project. You have to use the New Virtual Service dialog for this. -
Select how to input your API definition. You have two options:
-
File
- Enter the file path or URL of the API definition in the field provided.
- Alternatively, click the Browse button to locate and select the file from your computer.
-
SwaggerHub Integration
- Import an API definition from SwaggerHub. This option is available if you've integrated ReadyAPI with your SwaggerHub account. For more details on integration, see the SwaggerHub integration page.
-
Select one of the following options:
- My API: Search for and select an API from your private SwaggerHub account.
- Public API: Search for and select an API from publicly available APIs on SwaggerHub.
Tip: Use the Filters button to refine the API list:
- Select specific API specifications: OAS2, OAS3, OAS3.1, AsyncAPI, or All.
- Optionally, select Private or Public for My API.
- Click Select All or Deselect All to manage your filter selections.
Click Next.
-
-
Select the project to add the virtual API to. To create a new project, select <New Project>.
-
After you create a virtual service, ReadyAPI offers you to run it immediately, or edit it before starting or deploying.
If you selected to run the virtual service, ReadyAPI will run the service on your computer, and use the HTTP protocol and port 8088 by default. It will display the Virtual Service Overview window, where you can view and simulate virtual operations:
You can view the response data for simulated requests directly in the Virtual Service Overview window. To do this, simply select a request in the operation list. You can also check response data on the Transaction Log page of your virtual service editor.
Using the dialog
-
Select APIs (Virtual) in the Navigator panel and click Service on the toolbar:
This will invoke the New Virtual Service dialog (see below).
-
In the dialog, select Definition, choose the specification type (Swagger, WADL or WSDL) and click OK:
-
ReadyAPI will display a dialog where you will need to specify your Swagger, WADL or WSDL file. After that, ReadyAPI will create a new virtual service and add operations from the definition file to this service.
See Also
Creating Virtual Service From API Spec in Project
Creating Virtual Services