Skip to main content

object-can-be-a-reference

Overview

This rule belongs to the openapi-v3-standards-validation ruleset and states that:

An OpenAPI object can be replaced by a Reference Object if the OpenAPI v3 Specification explicitly states that the value may be a reference. You can therefore, not use $ref in objects that do not allow replacement by a Reference Object.

PropertyValue
EnabledYes
Maximum SeverityError
MessageThe current object value cannot be a Reference Object.
CodeOPENAPI3STANDARDS_V310
TypeValidation
Rule SystemSemantic
Broad CategoryReferences
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation reference json pointer ref $ref

Suggested Fixes

  • Remove $ref from the current object and define the referenced component directly in its place.

For More Information