ajv-json-logic
Version:
JSON Logic integration for Ajv validator
65 lines (63 loc) • 1.65 kB
JavaScript
var $schema = "http://json-schema.org/draft-07/schema#";
var $id = "http://jsonlogic.com/schemas/common/var.json";
var title = "Var";
var description = "Retrieve data from the provided data object.";
var oneOf = [
{
type: "array",
items: [
{
oneOf: [
{
$ref: "http://jsonlogic.com/schemas/common/pointer.json"
},
{
$ref: "http://jsonlogic.com/schemas/operators/logic/if.json"
}
]
},
{
$ref: "http://jsonlogic.com/schemas/common/all-types.json",
title: "Default",
description: "You can supply a default, as the second argument, for values that might be missing in the data object."
}
]
},
{
$ref: "http://jsonlogic.com/schemas/operators/array/map.json"
},
{
$ref: "http://jsonlogic.com/schemas/operators/array/merge.json"
},
{
$ref: "http://jsonlogic.com/schemas/operators/array/filter.json"
},
{
$ref: "http://jsonlogic.com/schemas/operators/array/reduce.json"
},
{
$ref: "http://jsonlogic.com/schemas/common/pointer.json",
title: "Shortcut",
description: "If you like, we support syntactic sugar to skip the array around single arguments."
},
{
type: "string",
"const": "",
title: "Entire data object",
description: "You can also use var with an empty string to get the entire data object – which is really useful in map, filter, and reduce rules."
},
{
type: "null",
title: "Null",
description: "Unknown null."
}
];
var varSchema = {
$schema: $schema,
$id: $id,
title: title,
description: description,
oneOf: oneOf
};
export { $id, $schema, varSchema as default, description, oneOf, title };
//# sourceMappingURL=var.json.js.map