identifier and jsonpath pairings to look up
JSON document that will be searched
identifier and results pairings found in the document
Example:
var queries = [{"one": "$.a"}, {"two": "$.b"}];
var document = {"a": "something", "b": "something else"};
var result = lookup(queries, document);
console.log(result);
// {
// "one": [{"path": ["$", "a"], "value": "something"}],
// "two": [{"path": ["$", "b"], "value": "something else"}]
// }
Checks that all keyrefs have an associated key
references to a key
identifier keys
validity status and any errors found
Example:
var keyrefs = [{"path": ["$", "some", "path"], "value": "example"}];
var keys = [{"path": ["$", "some", "other", "path"], "value": "example"}];
var result = referenceCheck(keyrefs, keys);
console.log(result); //=> {"isValid": true, "errors": []}
Validates a JSON document against a JSON schema with keyref and key constraints defined
document to be validated
schema with keyref and key groups defined
Example:
var document = {"a": "value", "b": "value"};
var schema = {
"keyrefs": {"identifier": "$.a"},
"keys": {"identifier": "$.b"}
};
var result = validate(document, schema);
console.log(result); //=> {"errors": [], "isValid": true}
Generated using TypeDoc
Searches for a set of jsonpath queries.