Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageLink Object has neither defined property operationRef nor operationId.
CodeOPENAPI3STANDARDS_V235
TypeValidation
Rule SystemSemantic
Broad CategoryLinks
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation operation ref operation id ref id operation link

Suggested Fixes

  • Add missing operationRef or operationId property in the Link Object.
  • Make sure that whatever property you specify (operationRef or operationId) 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