Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We should be lint-failing on $ref with siblings #1804

Open
acunniffe opened this issue Apr 4, 2023 · 1 comment
Open

We should be lint-failing on $ref with siblings #1804

acunniffe opened this issue Apr 4, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@acunniffe
Copy link
Member

acunniffe commented Apr 4, 2023

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 acunniffe added the bug Something isn't working label Apr 4, 2023
@niclim
Copy link
Contributor

niclim commented Jul 26, 2023

Additionally, we should detect things like:

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

This will cause similar issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants