Features
This section lists the supported features and compatibility checks PactFlow On-Premises applies when comparing consumer contracts (pact files) against an OpenAPI document.
Testing
Key
Y
- Fully supported.N
- No support. Either the feature is not supported, or is ignored for the purposes of the checksP
- Partial support (see description for caveats).
Use cases
Feature | Supported | Description | Example |
---|---|---|---|
Negative scenario testing | Y | Allow expectations for non-successful responses (e.g. 4xx, 5xx responses). | |
Inheritance and Polymorphism | Y | Inheritance is supported via the use of the | |
Content Negotiation (media types) | Y | Use of accept header to differentiate response, or to use as a versioning strategy. Fully complies with RFC 9110: HTTP Semantics §12. It supports:
| Examples: |
Vendor specific content types | Y | Allows organisations to use custom (vendor) created content types. See content negotiation above for more. |
OpenAPI Support
Open API Specification Versions
Spec Version | Supported | Description |
---|---|---|
1.x | N | |
2.0 | Y | |
3.0.x | Y | |
3.1.x | Y |
Document Format
Format | Supported |
---|---|
YAML | Y |
JSON | Y |
Resource Types
Feature | Supported | Description |
---|---|---|
HTTP | Y | |
Webhooks | N | Reverses the direction of the check, and doesn’t make sense (Pact can’t describe a consumer expecting a provider call) |
Full JSON Schema 2020-12 support, including resolving references ($ref)
Feature | Supported | Description | Example |
---|---|---|---|
N | The | ||
N | Ignored | ||
N | Ignored | ||
N | Ignored | ||
N | Ignored | ||
N | Ignored | ||
P | See below for details. | ||
Y | |||
N | Not supported | ||
P | See also https://swagger.io/docs/specification/serialization/ Missing parameters will cause a validation warning but not fail the checks We can’t currently compare non-primitive query string values to the OAS, because Pact does not encode the style of encoding. This means we can’t reliably differentiate the cases where an object or array is encoded. We can check primitive values match the schema. Where a pact interaction does not satisfy a parameter constraint, you will see a message such as: | ||
Path parameters | P | Understands primitive parameters, and is able to apply schema validation to primitive data types e.g., restricting values between 1-10 for integers. Does not support array or objects. | |
Query parameters | P | Query parameters are supported. If a query parameter used in a consumer test is not defined in the OAS, it will generate a warning. This allows consumers to deploy ahead of providers for certain use cases. You can configure query parameter behavior with the | |
Headers | Y | ||
Bodies | P | Full schema support on JSON bodies only | |
Status codes | Y | ||
N | Ignored | ||
N | Ignored | ||
N | Ignored | ||
P |
|
Keywords
See Keyword Support for additional information on this.
Feature | Supported | Description | Example |
---|---|---|---|
JSON | Y | Full support | |
XML | P | We don’t currently supported parsing and checking XML bodies, against defined schemas. Checks the content-type matches. | |
| N | Checks if the body matches the schema. | |
| N | By default, multipart bodies are not checked. May be enabled using the |
By default, the schema for security schemes is not checked. This may be enabled using the x-opc-config-no-authorization-schema
setting.
Feature | Supported | Description | Example |
---|---|---|---|
Y |
| ||
Basic | Y | Only checks the presence of an | |
API Key (cookie) | Y | ||
API Key (header) | Y | ||
Bearer | Y | Checks the presence and format of an | |
OpenID | P | The security scheme is allowed, but no additional checks are performed (e.g., checks for calls to a valid OIDC provider are not in scope, nor the checking of exchanged tokens) | |
OAuth | P | As per OpenID | |
P | Behaviour as above | ||
MASSL | P | The security scheme is allowed, but no additional checks are performed (e.g., no certificate checking on the requests can be performed for validity) | |
Multiple authentication types | N | Currently, only one security scheme can be applied and tested. Support for “OR” and “AND”. | |
Scopes | P | Allowed and ignored for the purposes of our checks |
Pact Support
Features
Feature | Supported | Description |
---|---|---|
HTTP | Y | HTTP based interactions |
Messages | N | Messages can’t be modelled appropriately in OpenAPI documents |
Plugins | N | Interactions containing plugins or custom content |
Matching Rules | N | Interactions containing plugins or custom content |