Skip to main content

resolvable-reference

Overview

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

The reference path provided in the Reference Object using the $ref property must be resolvable i.e. it must be a valid URI (relative or absolute) and should yield the referenced JSON value.

PropertyValue
EnabledYes
Maximum SeverityError
MessageUnresolvable reference found.
CodeOPENAPI3STANDARDS_L140
TypeLinting
Rule SystemSemantic
Broad CategoryReferences
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting reference path reference json pointer ref $ref

Suggested Fixes

  • Ensure that the component you are referencing does exist at the given path.
  • Ensure that the path to the component is a valid URI (relative or absolute)
  • Ensure that if the path is an absolute URL, the URL is publicly accessible, not broken nor hidden behind any authentication.
  • If the path references an external file, ensure that the file exists at the given path and is readable/not corrupt.
  • Ensure that the reference path is not null or empty.

For More Information