It reads an OAS specification YML file, collects information about endpoints, request & response properties (path & query parameters, headers & request bodies), data & security schemas, makes requests to the API and validates responses.
In order to make make valid requests, Oasis uses example data where available for path & query parameters, request headers & request bodies.
Some components of the OAS spec have been extended with additional Oasis-specific example fields to gain more control over requests. See the Schema extensions part.
At the moment Oasis supports the following OAS security types:
- API Key (OAS:
type: apiKey) - HTTP Basic (OAS:
type: http&scheme: basic) (See extensions) - HTTP Digest (OAS:
type: http&scheme: digest)(See extensions)
OAuth2 & OpenIdConnect are not supported because they require user interaction.
Oasis uses the OAS Responses as a definition of an operation response: a status code, headers & content schema where available.
The status code from the OAS Responses object is used.
The OAS Header object is used.
If a header has a required property, then it must be present in the operation response.
If it has a schema, then the header values will be validated against it. At least one value must be valid in order for test to succeed.
Oasis uses the OAS Schema definition to validate structured response data.
Properties' types are checked first.
If a property has a required set to true, it must be present in response data.
If a property has some of the following validation rules or value formats, those are used to further validate the value.
Supported validation rules:
- multipleOf
- maximum
- exclusiveMaximum
- minimum
- exclusiveMinimum
- maxLength
- minLength
- pattern
- maxItems
- minItems
- uniqueItems
- maxProperties
- minProperties
- required
- enum
Supported value formats:
| Format | Meaning | Example |
|---|---|---|
| date | A date value | |
| date-time | A date & time value | |
| hostname | A host name. | |
| An e-mail address. | ||
| ipv4 | A IP V4 address. | 127.0.0.1 |
| ipv6 | A IP V6 address. | fe80::10db:7611:fbff:2b3d |
In order to gain more control over the data used in requests, besides the standard and limited example field, Oasis introduces few extensions to the OAS schema.
| Field Name | Applies To | Description |
|---|---|---|
x-oasis-username |
HTTP Basic & Digest security | See below. |
x-oasis-password |
HTTP Basic & Digest security | A username & password pair to use for authentication instead of an encoded value from example. These fields have priority over the example field when present. |