In most cases, your ReadyAPI project contains at least one API, but you can add more if needed.
There are three main ways to add an API to the project:
Import from Definition
To import API from definition:
Click next to the APIs node and select Import API Definition:Show imageHide image
— or —
Right-click the APIs section in the Navigator and select Import API Definition.Show imageHide image
Use the Import API Definition dialog to import the definition:
Import the definition from a definition file: Swagger/OpenAPI, GraphQL, AsyncAPI (Kafka), gRPC, WSDL, or WADL.
Import the definition from SwaggerHub.
Import from file
To import an API from a definition file, specify the path to a local file, or its URL in the Source field and click Import API:
ReadyAPI defines the definition type automatically. If you need to specify advanced options, select the needed type manually from the Type drop-down list.
Below, you can find descriptions of the Advanced options for different definition types:
Swagger/OpenAPI Definition (REST)
Default Media Type - Specifies the media type that ReadyAPI will use for the requests in which no media type is specified.
When you load a large definition, ReadyAPI may fail to save the project because of the lack of Java heap space. To fix the issue, you can disable creating request samples.
Endpoint - Specify an endpoint to be added to the service’s endpoints.
WSDL Definition (SOAP)
WADL Definition (REST)
Create a test case for the imported WADL - Select this option if you want ReadyAPI to generate a test case.
There are currently no advanced options for AsyncAPI definitions.
There are currently no advanced options for gRPC definitions.
Import from SwaggerHub
ReadyAPI supports SwaggerHub SaaS and SwaggerHub On‑Premise 1.23.0-46 or later.
Use the SwaggerHub tab to import public or private definitions from SwaggerHub:
Select a definition or definitions that you want to add to your project.
My API contains APIs created by or shared with the SwaggerHub account that you have added to ReadyAPI. If you haven't added an account, click Log In to SwaggerHub.Log in to SwaggerHubLog in to SwaggerHub
If you use SwaggerHub On-Premise, select Use on-prem URL and enter the URL of your SwaggerHub instance.
In the Username field, enter your SwaggerHub username.
Note: The SwaggerHub integration does not support logging in with a GitHub account.
In the API Key field, enter your API key.
Tip: If you click Get API Key, you will be taken to the SwaggerHub API Keys page in your web browser. You can copy your API key from there.
Public API contains all the APIs in SwaggerHub that you have access to.
Tip: Use search and filter functionality to find the APIs you need.Filter referenceFilter reference
Shows APIs that are marked as Public in SwaggerHub.
Shows APIs that are marked as Private in SwaggerHub.
Shows OpenAPI Specification ver. 2 (Swagger 2.0) definitions.
Shows OpenAPI Specification ver. 3 definitions.
Shows only the APIs that have already been added to the project.
Shows the APIs which have been added to the project and of which a new version is available in SwaggerHub.
Select versions of definitions that will be imported. The default version (marked with ) of the definition is selected by default:
Click Import API.
You can also publish your API definition to SwaggerHub or SwaggerHub On-Premise. See Export to SwaggerHub for details.
SwaggerHub connection issue
If you cannot connect to SwaggerHub using your credentials, try regenerating API keys in SwaggerHub:
Open the account settings in SwaggerHub:
Switch to the API Keys tab and click Regenerate:
Edit your SwaggerHub account info in ReadyAPI and enter the new API key:
|Please note that, if you use these keys to access SwaggerHub’s public API, you need to update them in your code, as well.|
Create API Definition (For REST and Kafka services)
Click next to the APIs node and select Create API Definition:Show imageHide image
— or —
Right-click the APIs section in the Navigator and select Create API Definition.Show imageHide image
Specify the name of the API and protocol and click Create API: