Skip to content

Instantly share code, notes, and snippets.

Avatar

Yingliang Zhang yingliangzhang

View GitHub Profile
@yingliangzhang
yingliangzhang / json-editor-unique-array-properties.js
Created Dec 16, 2016
Unique validation for custom defined fields in an array property for json-editor
View json-editor-unique-array-properties.js
JSONEditor.defaults.custom_validators.push(function(schema, value, path) {
let errors = [];
if (schema.type !== 'object') {
return errors;
}
let property = '';
let uniqueValues = [];
let uniqueFieldsStr = '';