valid-callback-url-expression
Overview
This rule belongs to the openapi-v3-standards-validation ruleset and states that:
Callback Object keys must be valid runtime expressions as defined by the OpenAPI specification. The expression is evaluated at runtime to determine the URL for the callback request. The expression must conform to the runtime expression ABNF grammar defined in the specification.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | The callback URL expression is not a valid runtime expression. |
| Code | OPENAPI3STANDARDS_V216 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Callbacks |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic validation callbacks expression runtime url |
Suggested Fixes
- Ensure the callback URL expression follows the runtime expression format:
$url,$method,$statusCode,$request.header.name,$request.query.name,$request.path.name,$request.body#/pointer,$response.header.name, or$response.body#/pointer. - Check for typos or invalid characters in the runtime expression.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#runtime-expressions
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#runtime-expressions
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/