apoc.json.validate

Procedure APOC Full

apoc.json.validate('{json}' [,'json-path' , 'path-options']) - to check if the json is correct (returning an empty result) or not

Signature

apoc.json.validate(json :: STRING?, path = $ :: STRING?, pathOptions = null :: LIST? OF STRING?) :: (value :: STRING?)

Input parameters

Name Type Default

json

STRING?

null

path

STRING?

$

pathOptions

LIST? OF STRING?

null

Output parameters

Name Type

value

STRING?

Usage Examples

The parameters have the same behavior of the first 3 parameter of apoc.json.path functions

CALL apoc.json.validate('{"foo": [{"baz":  18446744062065078016838}],"baz": 18446744062065078016838}', '$')
Table 1. Results
value

"Error with key baz - Numeric value (18446744062065078016838) out of range of long (-9223372036854775808 - 9223372036854775807) at [Source: (String)"{"foo": [{"baz": 18446744062065078016838}],"baz": 18446744062065078016838}"; line: 1, column: 42]"

"Error with key baz - Numeric value (18446744062065078016838) out of range of long (-9223372036854775808 - 9223372036854775807) at [Source: (String)"{"foo": [{"baz": 18446744062065078016838}],"baz": 18446744062065078016838}"; line: 1, column: 75]"