var Ajv = require('ajv');
const ajv = new Ajv({
strict: true
});
const schema = {
"type": "object",
"properties": {
"property_a": {
"type": "string",
},
"property_b": {
"type": "string",
},
},
"anyOf": [
{ "required": [ "property_a" ] },
{ "required": [ "property_b" ] }
]
};
const validate = ajv.compile(schema);