Skip to main content

no-dollar-ref-sibling-properties

Overview

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

The Reference Object can only contain the property $ref and any sibling properties are not allowed. If specified, the additional properties will be ignored.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageA sibling property of property $ref detected.
CodeSWAGGER20STANDARDS_V281
TypeValidation
Rule SystemSemantic
Broad CategoryReferences
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger standards semantic validation sibling reference json pointer ref $ref

Suggested Fixes

  • Remove all other properties from the Reference Object except $ref.
  • If you do not remove the sibling properties, these properties will likely be ignored by the tools you are importing your file into.
  • Use allOf construct to wrap up the $ref object and any sibling data instead.

For More Information