-
Notifications
You must be signed in to change notification settings - Fork 187
Open
Labels
$refIncorrect behaviour when resolving references.Incorrect behaviour when resolving references.Type: BugSomething isn't workingSomething isn't workingp3v2
Description
Describe the bug
Consider the following example:
openapi: 3.1.0
paths:
/test:
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
type: object
examples:
Test:
value:
$ref: path/to/exmple.jsonWhen bundling, the content of the referenced file will be injected into the value.
Expected behavior
According to the spec and the refs guide, this behaviour is incorrect and the value should be taken literally, without resolving the $ref.
Note It is possible to use a Reference Object instead of Example Object (see the examples).
Note There's no restrictions on resolving $refs in the example property.
Redocly Version(s)
1.6.0
Additional context
The linter behaviour is correct though. See this issue for more details: #1369
Another issue with the $refs resolving: #1101
Metadata
Metadata
Assignees
Labels
$refIncorrect behaviour when resolving references.Incorrect behaviour when resolving references.Type: BugSomething isn't workingSomething isn't workingp3v2