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
Using the next example: const Ajv = require('ajv'); require('ajv-keywords')(ajv, 'uniqueItemProperties');
const schema = { uniqueItemProperties: ['id', 'name'] };
var invalidData2 = [ { id: 1, name: 'taco' }, { id: 2, name: 'taco' }, // duplicate "name" { id: 3, name: 'salsa' }, ]; const validate = ajv.compile(schema); console.log('validate errors: ', validate.errors);
The error message does not say which unique property is repeated. /* [ { keyword: 'uniqueItemProperties', dataPath: '', schemaPath: '#/uniqueItemProperties', params: { keyword: 'uniqueItemProperties' }, message: 'should pass "uniqueItemProperties" keyword validation' } ] */
The text was updated successfully, but these errors were encountered:
Create a PR #123. @epoberezkin could you please take a look at it??
Sorry, something went wrong.
No branches or pull requests
Using the next example:
const Ajv = require('ajv');
require('ajv-keywords')(ajv, 'uniqueItemProperties');
const schema = { uniqueItemProperties: ['id', 'name'] };
var invalidData2 = [
{ id: 1, name: 'taco' },
{ id: 2, name: 'taco' }, // duplicate "name"
{ id: 3, name: 'salsa' },
];
const validate = ajv.compile(schema);
console.log('validate errors: ', validate.errors);
The error message does not say which unique property is repeated.
/*
[ { keyword: 'uniqueItemProperties',
dataPath: '',
schemaPath: '#/uniqueItemProperties',
params: { keyword: 'uniqueItemProperties' },
message: 'should pass "uniqueItemProperties" keyword validation' } ]
*/
The text was updated successfully, but these errors were encountered: