-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconditional-validation.json
51 lines (51 loc) · 991 Bytes
/
conditional-validation.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Conditional Validation",
"description": "Require a data dictionary only if the metadata resource type is 'tabularDataset'.",
"$id": "require-fields.json",
"version": "1.0.0",
"properties": {
"metadata": {
"properties": {
"resourceInfo": {
"properties": {
"resourceType": {}
}
}
}
},
"dataDictionary": {}
},
"if": {
"properties": {
"metadata": {
"properties": {
"resourceInfo": {
"properties": {
"resourceType": {
"contains": {
"properties": {
"type": {
"const": "tabularDataset"
}
}
}
}
}
}
}
}
}
},
"then": {
"required": [
"metadata",
"dataDictionary"
]
},
"else": {
"required": [
"metadata"
]
}
}