JsonPointer
A JSON pointer represents a path to a field which can be a nested field in a semi-structured context. The name comes from the JSON Pointer specification because just like JSON Pointers we don’t support complex features or methods. The syntax however is closer to JSON Path given the dot notation.
When specifying simple top level fields without special characters, just putting the name of the field is most reasonable. However, for fields with characters that might require escaping or for semi structured fields this should use proper JSON notation.
For an object that looks like this:
{
"user": {
"name": "Validio User",
"tags": ["Data Engineer", "Data Science"]
}
}
The JsonPath for referencing name should be one of the following formats:
user.nameuser["name"]user['name']['user']['name']['user'].name
Not that the first syntax only works if both user and name contains no special characters
needing escaping.
For arrays such as tags Validio can do validations as well.
Validation on the first element in the array is done by referencing its index; user.tags[0].
Validation of the length of the array can be done by using the length function; users.tags.length().
Full documentation can be found here.
JsonPointer