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.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Unresolvable reference found. |
Code | OPENAPI3STANDARDS_L140 |
Type | Linting |
Rule System | Semantic |
Broad Category | References |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 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.