We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Symbol
additionalProperties: false
Hi there, thank you for your good work !
It seems additionalProperties which have a Symbol key do not throw with throwError.
additionalProperties
throwError
What am I doing wrong? Is this expected behavior?
const assert = require("assert").strict; const validate = require("jsonschema").validate; const schema = { type: "object", properties: { msg: { type: "string" } }, additionalProperties: false }; // Missing expected exception assert.throws(() => { validate({ msg: "hello", [Symbol("stealth")]: "oops" }, schema, { throwError: true }); }); assert.doesNotThrow(() => { validate({ msg: "hello" }, schema, { throwError: true }); }); assert.throws(() => { validate({ msg: "hello", extra: "boom" }, schema, { throwError: true }); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there, thank you for your good work !
It seems
additionalProperties
which have aSymbol
key do not throw withthrowError
.What am I doing wrong? Is this expected behavior?
The text was updated successfully, but these errors were encountered: