optic
optic copied to clipboard
We should be lint-failing on $ref with siblings
Describe the bug
Optic is not failing when linting specs that have $ref
and sibling properties specified:
field:
$ref: ...
type: object
The values are all getting merged. This happens at the dereference stage for some reason. The validation schema is working on a dereferenced spec, so it never sees a $ref.
Expected behavior Should fail when linting
Not allowed in OpenAPI https://swagger.io/docs/specification/using-ref/
Screenshots If applicable, add screenshots to help explain your problem.
Details (please complete the following information):
- OS and version: [e.g. Mac OS 13.1]
- Optic version: [e.g. v0.37.1]
- NodeJS version: [e.g. 18.0.0]
Additional context Add any other context about the problem here.
Additionally, we should detect things like:
schema:
type: object
oneOf / allOf / anyOf:...
This will cause similar issues