This add-on allows you to spider and import OpenAPI (Swagger) definitions, versions 1.2, 2.0, and 3.0.
Note: Generation of XML content is currently not supported.
The add-on will automatically detect any OpenAPI definitions and spider them as long as they are in scope.
It also supports the Automation Framework.
A menu item is added to the Import menu:
The dialogue allows overriding the server URL present in the OpenAPI definition (or specify one if not present) through the Target URL field. The import progress is shown in the progress tab.
The dialogues also allow selecting a Context, optionally. If a context is selected,
Note: Endpoints excluded by the Context will not be imported.
The dialogues also allow selecting a User, optionally, to do authenticated imports.
The Target URL has the following format:
scheme://authority/path
with all URI components optional. Note: while all URI components are optional the scheme and authority become mandatory when not importing from URL and the definition does not specify them (for example, it has no servers or schemes).
Following some examples, overriding:
localhost/api/
https://
qa.example.com:9090
/dev/v3/
The following operations are added to the API:
Both target
and hostOverride
support the Target URL
format explained earlier. The definitions will be imported synchronously and any warnings will be returned.
When the OpenAPI definition contains path parameters, and a context is specified during importing, the add-on will automatically generate data driven nodes. If no context is specified, no data driven nodes are generated. For example, the following OpenAPI definition will result in at least one data driven node.
...
/users/v1/{username}/email:
...
parameters:
- name: username
in: path
description: username to update email
required: true
schema:
type: string
...
The following nodes are added to the Sites Tree for the above endpoint:
Sites
└── http://example.com
└── users
└── v1
└── «username»
└── email
The imported OpenAPI definition is persisted to the session database. When the session is reloaded, the definition is used to generate the data driven nodes and mark them for future requests.
The following Command Line options are added:
The definitions will be imported synchronously and any warnings will be displayed on the command line.
Default values are used when importing OpenAPI definitions.
These can be overridden using the Form Handler add-on which allows you to specify your own values.
In most cases these will be simple values (like strings and integers) but in some cases you may need to specify structured values, e.g.
{ "id": 0, "name": "Freda" }
The add-on maintains the following statistics: