Skip to content

Commit

Permalink
fix composite_toggle schema
Browse files Browse the repository at this point in the history
+ fix some typos and trailing whitespaces in items schema

resolves #190
  • Loading branch information
Cyb3RGER authored and black-sliver committed Nov 3, 2024
1 parent b315c1c commit c1dcddd
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 156 deletions.
159 changes: 75 additions & 84 deletions schema/packs/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"false"
]
}
]
]
},
"codes": {
"$ref": "#/$defs/codes"
Expand All @@ -48,7 +48,7 @@
},
"required": [
"type"
],
],
"allOf": [
{
"$ref": "#/$defs/static_type_if_block"
Expand Down Expand Up @@ -107,6 +107,10 @@
],
"type": "string"
},
"name_stage": {
"description": "Readable name of the stage for tooltip.",
"type": "string"
},
"stages": {
"description": "Stages of the progressive item.",
"type": "array",
Expand Down Expand Up @@ -154,14 +158,13 @@
"$ref": "#/$defs/disabled_img_mods"
},
"name": {
"description": "Readable name of the stage for tooltip.",
"type": "string"
"$ref": "#/$defs/name_stage"
}
}
}
},
"initial_stage_idx": {
"description": "Initital stage index for the progressive item. Zero indexed.",
"description": "Initial stage index for the progressive item. Zero indexed.",
"anyOf": [
{
"type": "number",
Expand Down Expand Up @@ -235,7 +238,7 @@
"$ref": "#/$defs/stages"
},
"allow_disabled": {
"description": "Automatically addes a \"off\" stage if set to true.",
"description": "Automatically adds a \"off\" stage if set to true.",
"anyOf": [
{
"type": "boolean",
Expand Down Expand Up @@ -339,89 +342,77 @@
]
},
"then": {
"oneOf": [
{
"properties": {
"item_left": {
"description": "Code identifier of the left item.",
"type": "string"
},
"item_right": {
"description": "Code identifier of the right item.",
"type": "string"
}
},
"required": [
"item_left",
"item_right"
]
"properties": {
"item_left": {
"description": "Code identifier of the left item.",
"type": "string"
},
{
"properties": {
"images": {
"description": "Array of images and states (up to 4, on/off for each item)",
"type": "array",
"items": {
"type": "object",
"required": [
"left",
"right"
],
"properties": {
"left": {
"description": "State of left item.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": [
"true",
"false"
]
}
]
"item_right": {
"description": "Code identifier of the right item.",
"type": "string"
},
"images": {
"description": "Array of images and states (up to 4, on/off for each item)",
"type": "array",
"items": {
"type": "object",
"required": [
"left",
"right"
],
"properties": {
"left": {
"description": "State of left item.",
"anyOf": [
{
"type": "boolean"
},
"right": {
"description": "State of right item.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": [
"true",
"false"
]
}
{
"type": "string",
"enum": [
"true",
"false"
]
}
]
},
"right": {
"description": "State of right item.",
"anyOf": [
{
"type": "boolean"
},
"img": {
"$ref": "#/$defs/img"
},
"img_mods": {
"$ref": "#/$defs/img_mods"
},
"disabled_img": {
"$ref": "#/$defs/disabled_img"
},
"disabled_img_mods": {
"$ref": "#/$defs/disabled_img_mods"
},
"codes": {
"$ref": "#/$defs/codes"
{
"type": "string",
"enum": [
"true",
"false"
]
}
}
}
]
},
"img": {
"$ref": "#/$defs/img"
},
"img_mods": {
"$ref": "#/$defs/img_mods"
},
"disabled_img": {
"$ref": "#/$defs/disabled_img"
},
"disabled_img_mods": {
"$ref": "#/$defs/disabled_img_mods"
},
"name": {
"$ref": "#/$defs/name_stage"
}
}
},
"required": [
"images"
]
}
}
]
},
"required": [
"images"
]
}
},
"toggle_badged_type_if_block": {
Expand Down Expand Up @@ -552,7 +543,7 @@
"type": "string",
"pattern": "^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3}|[a-fA-F0-9]{8}|[a-fA-F0-9]{4})$"
}
},
},
"patternProperties": {
"^(overlay|badge)_font_size$": {
"description": "Font size of the overlay text displaying the quantity.",
Expand Down Expand Up @@ -587,7 +578,7 @@
"badge_font_size": true
}
}
],
],
"required": []
}
}
Expand Down
127 changes: 55 additions & 72 deletions schema/packs/strict/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
],
"type": "string"
},
"name_stage": {
"description": "Readable name of the stage for tooltip.",
"type": "string"
},
"stages": {
"description": "Stages of the progressive item.",
"type": "array",
Expand Down Expand Up @@ -131,8 +135,7 @@
"$ref": "#/$defs/disabled_img_mods"
},
"name": {
"description": "Readable name of the stage for tooltip.",
"type": "string"
"$ref": "#/$defs/name_stage"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -201,7 +204,7 @@
"$ref": "#/$defs/stages"
},
"allow_disabled": {
"description": "Automatically addes a \"off\" stage if set to true.",
"description": "Automatically adds a \"off\" stage if set to true.",
"type": "boolean"
},
"initial_stage_idx": {
Expand Down Expand Up @@ -318,79 +321,59 @@
"name": true,
"type": true,
"capturable": true,
"item_left": true,
"item_right": true,
"images": true,
"overlay_align": true
},
"additionalProperties": false,
"required": [
"codes"
],
"oneOf": [
{
"properties": {
"item_left": {
"description": "Code identifier of the left item.",
"type": "string"
},
"item_right": {
"description": "Code identifier of the right item.",
"type": "string"
},
"images": false
},
"required": [
"item_left",
"item_right"
]
"overlay_align": true,
"item_left": {
"description": "Code identifier of the left item.",
"type": "string"
},
{
"properties": {
"images": {
"description": "Array of images and states (up to 4, on/off for each item).",
"type": "array",
"items": {
"type": "object",
"required": [
"left",
"right"
],
"additionalProperties": false,
"properties": {
"left": {
"description": "State of left item.",
"type": "boolean"
},
"right": {
"description": "State of right item.",
"type": "boolean"
},
"img": {
"$ref": "#/$defs/img"
},
"img_mods": {
"$ref": "#/$defs/img_mods"
},
"disabled_img": {
"$ref": "#/$defs/disabled_img"
},
"disabled_img_mods": {
"$ref": "#/$defs/disabled_img_mods"
},
"codes": {
"$ref": "#/$defs/codes"
}
}
"item_right": {
"description": "Code identifier of the right item.",
"type": "string"
},
"images": {
"description": "Array of images and states (up to 4, on/off for each item).",
"type": "array",
"items": {
"type": "object",
"required": [
"left",
"right"
],
"additionalProperties": false,
"properties": {
"left": {
"description": "State of left item.",
"type": "boolean"
},
"right": {
"description": "State of right item.",
"type": "boolean"
},
"img": {
"$ref": "#/$defs/img"
},
"img_mods": {
"$ref": "#/$defs/img_mods"
},
"disabled_img": {
"$ref": "#/$defs/disabled_img"
},
"left_item": false,
"right_item": false
"disabled_img_mods": {
"$ref": "#/$defs/disabled_img_mods"
},
"name": {
"$ref": "#/$defs/name_stage"
}
}
},
"required": [
"images"
]
}
}
},
"additionalProperties": false,
"required": [
"item_left",
"item_right",
"images",
"codes"
]
}
},
Expand Down

0 comments on commit c1dcddd

Please sign in to comment.