Skip to content

Instantly share code, notes, and snippets.

@Zegnat Zegnat/kendo-filter.json
Last active Jul 3, 2016

Embed
What would you like to do?
JSON Schema for validating JSON representations of Kendo filters.
{
"$schema": "http:\/\/json-schema.org\/draft-04\/schema#",
"definitions": {
"filter": {
"oneOf": [
{
"type": "object",
"properties": {
"field": {
"type": "string",
"minLength": 1
},
"operator": {
"enum": [
"eq",
"neq",
"lt",
"lte",
"gt",
"gte",
"startswith",
"endswith",
"contains"
]
},
"value": {
"type": [
"string",
"number"
]
}
},
"required": [
"field",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"field": {
"type": "string",
"minLength": 1
},
"operator": {
"enum": [
"isnull",
"isnotnull",
"isempty",
"isnotempty"
]
}
},
"required": [
"field",
"operator"
],
"additionalProperties": false
}
]
},
"combinator": {
"type": "object",
"properties": {
"logic": {
"enum": [
"and",
"or"
]
},
"filters": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#\/definitions\/filter"
},
{
"$ref": "#\/definitions\/combinator"
}
]
}
}
},
"required": [
"logic",
"filters"
],
"additionalProperties": false
}
},
"oneOf": [
{
"$ref": "#\/definitions\/filter"
},
{
"$ref": "#\/definitions\/combinator"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.