required-link-operation-ref-or-id
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The Link Object must identify the location of an Operation Object that it targets, using either the operationRef
or operationId
property. However, at one time, only one of these properties must be present and not both.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Link Object has neither defined property operationRef nor operationId . |
Code | OPENAPI3STANDARDS_V235 |
Type | Validation |
Rule System | Semantic |
Broad Category | Links |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation operation ref operation id ref id operation link |
Suggested Fixes
- Add missing
operationRef
oroperationId
property in the Link Object. - Make sure that whatever property you specify (
operationRef
oroperationId
) is not empty or null. - operationRef is a URI reference path to an Operation Object.
- operationId is a unique identifier of the Operation Object in the specification.
- Because of the potential for name clashes, the operationRef syntax is preferred for specifications with external references.
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/