From c7e2063c83ebcbbf292a9c1874f533c42d8c29f5 Mon Sep 17 00:00:00 2001 From: MrVauxs Date: Sat, 7 Oct 2023 19:11:10 +0200 Subject: [PATCH 1/2] ChoiceSet Prototype --- schema/content/common/choiceSet.json | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 schema/content/common/choiceSet.json diff --git a/schema/content/common/choiceSet.json b/schema/content/common/choiceSet.json new file mode 100644 index 0000000..21281d1 --- /dev/null +++ b/schema/content/common/choiceSet.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "pf2ools-schema/content/common/choiceSet.json", + "title": "Choice Set", + "description": "A primitive array of available choices. Any array defaults to AND, and as such, there is no AND operator.", + "$ref": "#/definitions/choiceSet", + "definitions": { + "choiceSet": { + "type": "array", + "description": "A primitive array of available choices. Any array defaults to AND, and as such, there is no AND operator.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/choice" + }, + { + "$ref": "#/definitions/operators" + } + ] + } + }, + "choice": { + "type": "string", + "description": "WIP - A choice that can be made. In the future we may instead use a more complex object to represent a choice, like a feat and source, but for now this is just a string." + }, + "operators": { + "oneOf": [ + { + "$ref": "#/definitions/or" + }, + { + "$ref": "#/definitions/not" + } + ] + }, + "or": { + "type": "object", + "description": "An array of choices that can be made. If any of the choices are made, the OR operator is satisfied.", + "properties": { + "or": { + "$ref": "#/definitions/choiceSet" + } + }, + "required": [ + "or" + ] + }, + "not": { + "type": "object", + "description": "An array of choices that are *excluded*. If none of the choices are made, the NOT operator is satisfied.", + "properties": { + "not": { + "$ref": "#/definitions/choiceSet" + } + }, + "required": [ + "not" + ] + } + } +} \ No newline at end of file From 6865dddb2cf4a46fe7e6f107675284f879864231 Mon Sep 17 00:00:00 2001 From: MrVauxs Date: Sat, 7 Oct 2023 19:14:21 +0200 Subject: [PATCH 2/2] Is this even valid? --- schema/content/common/choiceSet.json | 30 ++++++++++++---------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/schema/content/common/choiceSet.json b/schema/content/common/choiceSet.json index 21281d1..bd9e376 100644 --- a/schema/content/common/choiceSet.json +++ b/schema/content/common/choiceSet.json @@ -3,22 +3,18 @@ "$id": "pf2ools-schema/content/common/choiceSet.json", "title": "Choice Set", "description": "A primitive array of available choices. Any array defaults to AND, and as such, there is no AND operator.", - "$ref": "#/definitions/choiceSet", - "definitions": { - "choiceSet": { - "type": "array", - "description": "A primitive array of available choices. Any array defaults to AND, and as such, there is no AND operator.", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/choice" - }, - { - "$ref": "#/definitions/operators" - } - ] + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/choice" + }, + { + "$ref": "#/definitions/operators" } - }, + ] + }, + "definitions": { "choice": { "type": "string", "description": "WIP - A choice that can be made. In the future we may instead use a more complex object to represent a choice, like a feat and source, but for now this is just a string." @@ -38,7 +34,7 @@ "description": "An array of choices that can be made. If any of the choices are made, the OR operator is satisfied.", "properties": { "or": { - "$ref": "#/definitions/choiceSet" + "$ref": "#" } }, "required": [ @@ -50,7 +46,7 @@ "description": "An array of choices that are *excluded*. If none of the choices are made, the NOT operator is satisfied.", "properties": { "not": { - "$ref": "#/definitions/choiceSet" + "$ref": "#" } }, "required": [