Skip to content

Commit

Permalink
Fix validation of prerequisiteTag values:
Browse files Browse the repository at this point in the history
v6.0.0 does falsely disallow requirements with only a `key` but neither `value` nor `valueNot`
  • Loading branch information
tyrasd committed Jan 20, 2023
1 parent 231bb5a commit 7e9bed5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
[#x]: https://github.com/ideditor/schema-builder/issues/x
-->

# 6.0.1
##### 2023-Jan-20

* Fix bug in validation of `prerequisiteTag` values (v6.0.0 does falsely disallow requirements with only a `key` but neither `value` nor `valueNot`)

# 6.0.0
##### 2023-Jan-20

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "@ideditor/schema-builder",
"version": "6.0.0",
"version": "6.0.1",
"description": "Framework for defining iD-compatible tagging models",
"homepage": "https://github.com/ideditor/schema-builder#readme",
"bugs": "https://github.com/ideditor/schema-builder/issues",
Expand Down
22 changes: 18 additions & 4 deletions schemas/field.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,19 @@
"description": "Tagging constraint for showing this field in the editor",
"oneOf": [
{
"$id": "requires-key-is-value",
"$id": "requires-key-any-value",
"type": "object",
"properties": {
"key": {
"description": "The key of the required tag",
"type": "string",
"required": true
}
},
"additionalProperties": false
},
{
"$id": "requires-key-equals-value",
"type": "object",
"properties": {
"key": {
Expand All @@ -181,13 +193,14 @@
},
"value": {
"description": "The value that the tag must have. (alternative to 'valueNot')",
"type": "string"
"type": "string",
"required": true
}
},
"additionalProperties": false
},
{
"$id": "requires-key-is-not-value",
"$id": "requires-key-not-value",
"type": "object",
"properties": {
"key": {
Expand All @@ -197,7 +210,8 @@
},
"valueNot": {
"description": "The value that the tag cannot have. (alternative to 'value')",
"type": "string"
"type": "string",
"required": true
}
},
"additionalProperties": false
Expand Down

0 comments on commit 7e9bed5

Please sign in to comment.