diff --git a/CHANGELOG.md b/CHANGELOG.md index 206ec3f..39644bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/package.json b/package.json index 697f325..9d0d0df 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/schemas/field.json b/schemas/field.json index ba28345..d0fbca8 100644 --- a/schemas/field.json +++ b/schemas/field.json @@ -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": { @@ -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": { @@ -197,7 +210,8 @@ }, "valueNot": { "description": "The value that the tag cannot have. (alternative to 'value')", - "type": "string" + "type": "string", + "required": true } }, "additionalProperties": false