OpenAPI
The openapi
block configures the backend's proxy behavior to validate outgoing
and incoming requests to and from the origin, preventing the origin from invalid
requests and the Couper client from invalid answers.
To do so Couper uses the OpenAPI 3 standard to load
the definitions from a given document defined with the file
attribute.
⚠️ While ignoring request violations an invalid method or path would lead to a non-matching route which is still required for response validations. In this case the response validation will fail if not ignored, too.
Block name | Context | Label |
---|---|---|
openapi | Backend Block | no label |
Attributes
Name | Type | Default | Description |
---|---|---|---|
file | string | - | OpenAPI YAML definition file. |
ignore_request_violations | bool | false | Logs request validation results, skips error handling. |
ignore_response_violations | bool | false | Logs response validation results, skips error handling. |
Example
openapi {
file = "openapi.yaml"
ignore_response_violations = true
}
You can find a detailed example here.