pre-defined-operation-for-link-operation-id
Overview
This rule belongs to the openapi-v3-standards-validation ruleset and states that:
The property operationId in the Link Object must refer uniquely to a pre-existing Operation Object in the current API document.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Operation Object referenced by the Link Object via operationId does not exist. |
| Code | OPENAPI3STANDARDS_V238 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Links |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic validation id operation id operation link |
Suggested Fixes
- Ensure that the value of operation's id is not null or empty.
- Make sure that the id referenced in the Link Object matches exactly with the
operationIdof an Operation Object in the current API document. Id is compared in a case-sensitive manner. - Make sure that the Operation Object you are referencing is already defined in the current API document.
- Ensure that there is only one instance of an operation with the given operationId i.e. the operationId is unique among all operations in the document.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#link-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#link-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/