Skip to content

Commit cbc7096

Browse files
committed
fix: filter schema
1 parent 2836fb5 commit cbc7096

1 file changed

Lines changed: 29 additions & 23 deletions

File tree

schemas/list.json

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@
2323
},
2424
"filter": {
2525
"type": "object",
26+
"properties": {
27+
"#multi": {
28+
"type": "object",
29+
"required": [ "fields", "match" ],
30+
"properties": {
31+
"fields": {
32+
"type": "array",
33+
"minItems": 1,
34+
"items": {
35+
"type": "string",
36+
"minLength": 1
37+
}
38+
},
39+
"match": {
40+
"type": "string",
41+
"minLength": 1
42+
}
43+
}
44+
}
45+
},
2646
"patternProperties": {
2747
"^.+$": {
2848
"oneOf": [
@@ -33,30 +53,16 @@
3353
{
3454
"type": "object",
3555
"minProperties": 1,
56+
"maxProperties": 2,
3657
"properties": {
37-
"gte": {
38-
"oneOf": [
39-
{
40-
"type": "string",
41-
"minLength": 1
42-
},
43-
{
44-
"type": "integer",
45-
"minimum": 0
46-
}
47-
]
48-
},
49-
"lte": {
50-
"oneOf": [
51-
{
52-
"type": "string",
53-
"minLength": 1
54-
},
55-
{
56-
"type": "integer",
57-
"minimum": 0
58-
}
59-
]
58+
"patternProperties": {
59+
"^(ne|eq|match)$": {
60+
"type": "string",
61+
"minLength": 1
62+
},
63+
"^(gte|lte)$": {
64+
"type": "number"
65+
}
6066
}
6167
}
6268
}

0 commit comments

Comments
 (0)