Validators
TBD - create a language agnostic spec, and force all impl to support custom validators
{
"$service+": {
"name": "$name:identifier"
},
"@types": {
"identifier": {
"type": "string",
"range": {
"min": 1,
"max": 5
}
}
}
}
const jc = require('json-concepts');
jc.options.addValidator('range', function(value, args) {
return value.length >= args.min && value.length <= args.max;
});