valid-callback-key-expression
Overview
This rule belongs to the openapi-v3-syntax-validation
ruleset and states that:
Callback key is a string used for identifying the Path Item Object and is capable of supporting runtime expressions which are evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request. The key must use valid runtime expression syntax. Expressions can be embedded into string values by surrounding the expression with {} curly braces.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Invalid callback key found. |
Code | OPENAPI3SYNTAX_V080 |
Type | Validation |
Rule System | Syntax |
Broad Category | Callbacks |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi syntax validation runtime expression expression callback |
Suggested Fixes
- Ensure that if you are using runtime expressions in your callback key string, the expressions follow valid syntax rules.
- Ensure that all expressions start and end with a curly brace.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#key-expression
- 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#key-expression
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#runtime-expressions
- https://tools.ietf.org/html/rfc5234
- https://www.rfc-editor.org/rfc/rfc6901
- https://www.rfc-editor.org/rfc/rfc7159#section-7
- https://www.rfc-editor.org/rfc/rfc7230#section-3.2.6
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/