Skip to content

Instantly share code, notes, and snippets.

View yingliangzhang's full-sized avatar

Yingliang Zhang yingliangzhang

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