xdmp.jsonValidateNode( node as Node, schema as Node, options as String[] ) as Node
Validate a JSON node against a JSON Schema. If the node is not valid per the schema, raise an error. Otherwise, return the input node.
xdmp.jsonValidateNode( { "count": 3, "items": [12] }, { "properties": { "count": { "type":"integer", "minimum":0 }, "items": { "type":"array", "items": {"type":"string", "minLength":1 } } } }) => XDMP-JSVALIDATEINVTYPE: xdmp.jsonValidateNode( -- Invalid node type: Expected node of type text, found number at NumberNode(12) using schema ""