Configuration
You can customize the behavior of the comparison checks using OpenAPI extensions.
The extensions follow the format: x-opc-config-${extension}
, where the extension
matches one of the items below. To be recognized by PactFlow On-Premises, you must add the extension to the info
section of your OpenAPI Specification (OAS). For example, to customize the Base URL for comparisons, add the following:
openapi: 3.1.0 info: x-opc-config-base-path: /custom-prefix title: OAS version: 1.0.0 paths: /path: get: responses: "200": description: ok
This results in checks matching the path /custom-prefix/path
, rather than simply /path
.
Configuration Options
With the introduction of a new comparison engine (April 2025), we added additional capabilities to PactFlow.
Some of the changes are not backward compatible with the previous engine and are disabled by default to prevent unexpected build failures. The table below describes the options available.
Categories of options
Compatibility mode. Items labeled "compatibility mode" indicate a new (and likely, improved) behavior is suppressed to ensure it remains consistent with the previous behavior.
Bugs. Items labeled "bug" indicate a bug in the previous engine - these are almost certainly suppressing a genuine issue and should be disabled as soon as possible.
Behavior. Items labeled "behavior" indicate a preference for how the tool should behave under certain conditions.
Options
Option | Default Value | Description | Example |
---|---|---|---|
|
| Bug. The previous engine interpreted the literal string | N/A |
|
| Compatibility mode. Disables validation of multipart forms. Setting this to true ignores all multipart request/response bodies during in validation. | N/A |
|
| Compatibility mode. Duplicate slashes (for example, |
|
|
| Compatibility mode. Trailing slashes. |
|
|
| Compatibility mode. Supports nested query string objects and key/value pairs in |
|
|
| Compatibility mode. Disables validation against schema. |
|
|
| Compatibility mode. Allows percentages in path, even if it is not percent encoded. | N/A |
|
| Bug. The previous engine had a bug whereby nullable response schemas were not transformed correctly. | N/A |
|
| Compatibility mode. | Given the header |
|
| Bug. The previous engine ignored body matching if the schema didn't include | N/A |
|
| Behavior. In OAS 3 and 2, all API endpoints are considered to be relative to the base URL. For example, assuming the base URL of |
|