Skip to main content

object-can-be-a-reference

Overview

This rule belongs to the swagger-v2-standards-validation ruleset and states that:

A Swagger object can be replaced by a Reference Object if the Swagger v2 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.
CodeSWAGGER20STANDARDS_V280
TypeValidation
Rule SystemSemantic
Broad CategoryReferences
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger 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