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

ajv-cli dies when evaluating yaml with duplicate object keys #211

Open
Qstick opened this issue Jun 19, 2022 · 1 comment · May be fixed by #212
Open

ajv-cli dies when evaluating yaml with duplicate object keys #211

Qstick opened this issue Jun 19, 2022 · 1 comment · May be fixed by #212

Comments

@Qstick
Copy link

Qstick commented Jun 19, 2022

When running on yml with duplicate object keys, ajv fails and errors out with the following error. Let me know if this is something I'm missing on my side?

Command

ajv validate -d "definitions/v3/*.yml" -s "definitions/v3/schema.json" --verbose 

Error:

error:  Invalid left-hand side expression in prefix operation

Example Yaml

---
id: example
name: Example

caps:
  date: pass
  date: other

Version: 5.0.0 (installed via npm)
Scemas: Tested with a draft07 and draft2020

@Qstick
Copy link
Author

Qstick commented Jun 19, 2022

A bit more info on the full stack trace

SyntaxError: Invalid left-hand side expression in prefix operation
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at openFile (C:\Users\qstic\source\repos\ajv-cli\dist\commands\util.js:56:20)
    at validateDataFile (C:\Users\qstic\source\repos\ajv-cli\dist\commands\validate.js:37:42)

@Qstick Qstick linked a pull request Jun 19, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant