
xdmp:json-validate-node( $node as node(), $schema as node(), $options as xs: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:json-validate-node(
object-node{ "count": 3, "items": array-node{12} },
object-node{
"properties": object-node{
"count": object-node{ "type":"integer", "minimum":0 },
"items": object-node{ "type":"array", "items": object-node{"type":"string", "minLength":1 } }
}
})
=> XDMP-JSVALIDATEINVTYPE: Invalid node type: Expected node of type text, found number at number-node{12} using schema ""
at 1:0 [1.0-ml]