valid-dollar-ref-path
Overview
This rule belongs to the swagger-v2-syntax-validation
ruleset and states that:
The '$ref' values must be RFC3986-compliant percent-encoded URIs.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Provided $ref path is invalid. |
Code | SWAGGER20SYNTAX_V060 |
Type | Validation |
Rule System | Syntax |
Broad Category | References |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | swagger2 swagger syntax validation $ref uri reference |
Suggested Fixes
- Ensure that the value of $ref is a valid URI.
- Ensure that the URI value does not contain any forbidden characters.
- Ensure that the $ref value is not empty or null.
- Ensure that the reference path set in the $ref property is a valid path to the component you intend to reference.
For More Information
- https://datatracker.ietf.org/doc/html/draft-pbryan-zyp-json-ref-03
- https://www.rfc-editor.org/rfc/rfc6901
- https://datatracker.ietf.org/doc/html/rfc3986
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#reference-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md
- https://docs.apimatic.io/rulesets/overview/