optic icon indicating copy to clipboard operation
optic copied to clipboard

We should be lint-failing on $ref with siblings

Open acunniffe opened this issue 1 year ago • 1 comments

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.

acunniffe avatar Apr 04 '23 16:04 acunniffe

Additionally, we should detect things like:

schema:
  type: object
  oneOf / allOf / anyOf:...

This will cause similar issues

niclim avatar Jul 26 '23 18:07 niclim