ajv-validator / ajv-validator/ajv-keywords
improve uniqueItemProperties messages
- Dominant language
- TypeScript
- Stars
- 257
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
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' } ]
*/
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.