redocly-cli
redocly-cli copied to clipboard
Wrong lint message when referencing from a wrong location
Describe the bug
If a valid part of a definition is being referenced from a section that does not expect this syntax, the linter shows an incorrect message inside the valid part.
To Reproduce
Consider this definition:
# openapi.yaml
openapi: 3.0.0
components:
requestBodies:
CreateContainer:
content:
application/json:
schema:
type: object
schemas:
PipeContainerCreate:
title: PipelineContainerCreate
allOf:
- "$ref": "#/components/requestBodies/CreateContainer"
Run redocly lint openapi.yaml --extends minimal
Although the requestBody could receive the content field, linter notes that Property content is not expected here..
Expected behavior
We need to handle this common issue and show a proper message and a "referenced from".
Redocly Version(s)
1.0.0-beta.104
Node.js Version(s)
v16.14.0
Additional context See this conversation for additional context.