Skip to content

HelpAddonsOpenapiOpenapi

thc202 edited this page Jul 18, 2019 · 9 revisions

Open API Specification Support

This add-on allows you to spider and import OpenAPI (Swagger) definitions (versions 1.2 and 2.0).

The add-on will automatically detect any Open API definitions and spider them as long as they are in scope.

UI

2 menu items are added to the Import menu:

  • Import an Open API definition from the local file system
  • Import an Open API definition from a URL

The URL Import dialog supports an optional additional field that allows you to override the Host (and port) in the definition with an alternative one that you supply. This option is not provided for the file import as it's easy to change a local file to use a different host.

API

The following operations are added to the API:

  • ACTION importFile (file)
  • ACTION importUrl (url, hostOverride)

The definitions will be imported synchronously and any warnings will be returned.

Command Line

The following Command Line options are added:

  • -openapifile : Import an Open API definition from the specified file name
  • -openapiurl : Import an Open API definition from the specified URL

The definitions will be imported synchronously and any warnings will be displayed on the command line.

User Specified Values

Default values are used when importing Open API 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" }
Clone this wiki locally