Skip to content

Commit 7e9bed5

Browse files
committed
Fix validation of prerequisiteTag values:
v6.0.0 does falsely disallow requirements with only a `key` but neither `value` nor `valueNot`
1 parent 231bb5a commit 7e9bed5

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
[#x]: https://github.com/ideditor/schema-builder/issues/x
88
-->
99

10+
# 6.0.1
11+
##### 2023-Jan-20
12+
13+
* Fix bug in validation of `prerequisiteTag` values (v6.0.0 does falsely disallow requirements with only a `key` but neither `value` nor `valueNot`)
14+
1015
# 6.0.0
1116
##### 2023-Jan-20
1217

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "module",
33
"name": "@ideditor/schema-builder",
4-
"version": "6.0.0",
4+
"version": "6.0.1",
55
"description": "Framework for defining iD-compatible tagging models",
66
"homepage": "https://github.com/ideditor/schema-builder#readme",
77
"bugs": "https://github.com/ideditor/schema-builder/issues",

schemas/field.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,19 @@
171171
"description": "Tagging constraint for showing this field in the editor",
172172
"oneOf": [
173173
{
174-
"$id": "requires-key-is-value",
174+
"$id": "requires-key-any-value",
175+
"type": "object",
176+
"properties": {
177+
"key": {
178+
"description": "The key of the required tag",
179+
"type": "string",
180+
"required": true
181+
}
182+
},
183+
"additionalProperties": false
184+
},
185+
{
186+
"$id": "requires-key-equals-value",
175187
"type": "object",
176188
"properties": {
177189
"key": {
@@ -181,13 +193,14 @@
181193
},
182194
"value": {
183195
"description": "The value that the tag must have. (alternative to 'valueNot')",
184-
"type": "string"
196+
"type": "string",
197+
"required": true
185198
}
186199
},
187200
"additionalProperties": false
188201
},
189202
{
190-
"$id": "requires-key-is-not-value",
203+
"$id": "requires-key-not-value",
191204
"type": "object",
192205
"properties": {
193206
"key": {
@@ -197,7 +210,8 @@
197210
},
198211
"valueNot": {
199212
"description": "The value that the tag cannot have. (alternative to 'value')",
200-
"type": "string"
213+
"type": "string",
214+
"required": true
201215
}
202216
},
203217
"additionalProperties": false

0 commit comments

Comments
 (0)