This project contains language-agnostic test files for the JSONata querying/transformation language.
In general, one directory in data corresponds to one test case or one block of related test directories. Directories are grouped according to functional area. A typical test case contains three files:
expression.jsonata, containing a JSONata expression to be compiled.input.json, containing the input to the compiled expression.output.json, containing the expected output.
input.jsonandoutput.jsonmay instead contain the string "undefined", indicating thatundefinedshould be used as input/expected as output respectively.bindings.jsonmay also be present. This object contains variable names and values to be bound into the JSONata expression before evaluation.- If
output.jsonis missing, JSONata should throw an exception at evaluation time. - If
input.jsonis also missing, JSONata should throw an exception at expression compilation time.
expression.jsonata:
Account.Order[0].OrderID
input.json:
{
"Account": {
"Account Name": "My Account",
"Order": [
{
"OrderID": "order103"
},
{
"OrderID": "order104"
}
]
}
}output.json:
"order103"