OpenAPI Specification (formerly Swagger Specification) is an API description format for REST APIs. OpenAPI (Swagger) document needs to be hosted online and should be reached without authentication. You need to provide a URL to this document in the credentials.
Using OpenAPI Specification make request to REST API on elastic.io platform.
Currently, it is supported OpenAPI version 2.0 documents. It is used Swagger Client version 3.10.0. OpenAPI Specification.
Authentication type field to define the authentication schema that would be used for making request. It is supported 4 auth type:
No Auth- used by default, make request without authentication.Basic Auth- make request with basic authentication,UsernameandPasswordfields should be specified:
API Key Auth- make request with API key in headers authentication,Header NameandHeader Valuefields should be specified:
OAuth2- it is supportedAuthorization codeOAuth2 flow. Fields:Client Id- is a public identifier for appsClient Secret- is a secret known only to the application and the authorization serverAuth URI- uri for authorizationToken URI- uri for getting an access tokenScopes- is a scope of the access request
A URL to an OpenAPI/Swagger document that would define the calls that could be made, as example https://petstore.swagger.io/v2/swagger.json
A dropdown for the paths than defined in the OpenAPI document.
A dropdown for the operations that are allowed for a previously defined path.
An option as to whether or not errors should be thrown for HTTP codes in the 4xx/5xx range.
NOTE: an exception is the 401 HTTP status code - error would be thrown for this code regardless of field value (true/false)
Input metadata is depend on parameters, that are defined in operation:
path parameters are defined as a separate fields, and body as object that should be configured by user.
For example, path /pet/{petId} and operation get metadata is:
{
"type": "object",
"properties": {
"petId": {
"type": "integer",
"required": true
}
}
}OpenApi Description for path `/pet/{petId}` and operation `get`
{
"paths": {
"/pet/{petId}": {
"get": {
"tags": [
"pet"
],
"summary": "Find pet by ID",
"description": "Returns a single pet",
"operationId": "getPetById",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet to return",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Pet not found"
}
},
"security": [
{
"api_key": []
}
]
}
}
}
}
{
"type": "object",
"properties": {
"headers": {
"type": "object",
"properties": {},
"required": true
},
"body": {
"type": "object",
"properties": {},
"required": true
},
"responseCode": {
"type": "number",
"required": true
}
}
}- OpenApi v2.0 is supported only
- Multiply hosts are not supported
- Each operation should contains only one tag
- Authentication for access to OpenAPI (Swagger) file is not supported
- OAuth2 authentication type is not supported in real-time flows due to platform limitations






