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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
What version of Ajv are you using? Does the issue happen if you use the latest version? 6.1.1, yes.
6.1.1
Ajv options object
{ allErrors: true, useDefaults: true, removeAdditional: 'all', coerceTypes: 'array', }
JSON Schema
{ "type": "string", "const": "EVENT", "default": "EVENT" }
Sample data
"FOO"
Your code
ajv.validate({ "type": "string", "const": "EVENT" }, 'FOO');
Validation result, data AFTER validation, error messages
[ { "keyword": "const", "dataPath": "", "schemaPath": "#/const", "params": {}, "message": "should be equal to constant" } ]
What results did you expect?
This issue is virtually identical to #282, i.e. that it would be nice if the error payload contained a reference to the required constant value.
Are you going to resolve the issue?
I would need to investigate the templating stuff before submitting a fix, but the issue should be resolved by adding allowedValue (or similar) here.
allowedValue
The text was updated successfully, but these errors were encountered:
Yes, that’s ok, makes error reporting more consistent. Implementation should be quite straightforward, see the PR that closed the other issue.
Sorry, something went wrong.
@epoberezkin great, I'll have a PR up in the next day or two.
aabd995
No branches or pull requests
What version of Ajv are you using? Does the issue happen if you use the latest version?
6.1.1
, yes.Ajv options object
JSON Schema
Sample data
"FOO"
Your code
Validation result, data AFTER validation, error messages
What results did you expect?
This issue is virtually identical to #282, i.e. that it would be nice if the error payload contained a reference to the required constant value.
Are you going to resolve the issue?
I would need to investigate the templating stuff before submitting a fix, but the issue should be resolved by adding
allowedValue
(or similar) here.The text was updated successfully, but these errors were encountered: