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
normal and ref schemas return different messages. I would expect messages to be same, indefepndent f I use ref or not.
{ field: 'data.a', message: 'is the wrong type' } [ { field: 'data.a', message: 'referenced schema does not match' } ](too vague, BUGGy ? why not the same)
see code, I have tested also on ref.json in tests, with the same results (vague messages returned)
// comparing error messages from normal an ref schema var validator = require("is-my-json-valid"); var validate = validator({ properties: { a: { type: 'integer' } }, "required": ["a"] });
validate({ a: 'string' }); console.log(validate.errors); assert.deepEqual(validate.errors, [{ field: 'data.a', message: 'is the wrong type' }]); //now lets do the same with $ref var validate = validator({ properties: { a: { $ref: "#/definitions/a" } }, "required": ["a"], definitions: { a: { type: 'integer' } } }); validate({ a: 'string' }); console.log(validate.errors); assert.deepEqual(validate.errors, [{ field: 'data.a', message: 'is the wrong type' }]);
The text was updated successfully, but these errors were encountered:
This was changed in 2.0.2. I don't know what the reasoning was
2.0.2
Sorry, something went wrong.
No branches or pull requests
normal and ref schemas return different messages.
I would expect messages to be same, indefepndent f I use ref or not.
{ field: 'data.a', message: 'is the wrong type' }
[ { field: 'data.a', message: 'referenced schema does not match' } ](too vague, BUGGy ? why not the same)
see code, I have tested also on ref.json in tests, with the same results (vague messages returned)
// comparing error messages from normal an ref schema
var validator = require("is-my-json-valid");
var validate = validator({
properties: {
a: {
type: 'integer'
}
},
"required": ["a"]
});
The text was updated successfully, but these errors were encountered: