Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict Custom Homebrew Item Properties #3

Merged
merged 12 commits into from
Sep 18, 2023
27 changes: 11 additions & 16 deletions schema-template/items-base.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "items-base.json",
"version": "1.5.10",
"version": "1.5.11",
"$defs": {
"itemPropertyLookupArray": {
"type": "array",
Expand Down Expand Up @@ -263,6 +263,15 @@
"speed": {
"$ref": "items-shared.json#/$defs/itemSpeed"
},
"$$if": {
"modes": ["brew", "ua"],
"value": {
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
}
}
},
"$$ifBrew": {
"currencyConversion": {
"description": "ID of a value conversion table. Homebrew only.",
Expand Down Expand Up @@ -356,21 +365,7 @@
"hasFluff": {"type": "boolean"},
"hasFluffImages": {"type": "boolean"}
},
"$$if": {
"modes": ["site", "ua"],
"value": {
"additionalProperties": false
}
},
"$$ifBrew": {
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
}
}
"additionalProperties": false
},

"baseitem": {
Expand Down
27 changes: 11 additions & 16 deletions schema-template/items.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "items.json",
"version": "1.14.1",
"version": "1.14.2",
"type": "object",
"$defs": {
"itemData": {
Expand Down Expand Up @@ -467,6 +467,15 @@
"description": "Whether this item has references within its data to dedicated \"itemEntry\"s."
},

"$$if": {
"modes": ["brew", "ua"],
"value": {
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
}
}
},
"$$ifBrew": {
"acSpecial": {
"description": "Free text field for homebrew use.",
Expand Down Expand Up @@ -494,21 +503,7 @@
}
}
},
"$$if": {
"modes": ["site", "ua"],
"value": {
"additionalProperties": false
}
},
"$$ifBrew": {
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
}
}
"additionalProperties": false
},

"item": {
Expand Down
83 changes: 43 additions & 40 deletions schema-template/magicvariants.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "magicvariants.json",
"version": "1.8.4",
"version": "1.8.5",
"type": "object",
"properties": {
"magicvariant": {
Expand Down Expand Up @@ -41,17 +41,21 @@
"scfType": {"$ref": "items-shared.json#/$defs/itemScfType"},
"net": {"type": "boolean"},
"weaponCategory": {"$ref": "items-shared.json#/$defs/itemWeaponCategory"},
"property": {"type": "string"}
},
"$$if": {
"modes": ["site", "ua"],
"value": {
"additionalProperties": false
"property": {"type": "string"},
"$$if": {
"modes": ["brew", "ua"],
"value": {
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object",
"items": {
"type": "boolean"
}
}
}
}
},
"$$ifBrew": {
"additionalProperties": {"type": "boolean"}
}
"additionalProperties": false
}
},
"inherits": {
Expand Down Expand Up @@ -219,6 +223,15 @@
},
"mastery": {"$ref": "items-shared.json#/$defs/itemMastery"},
"reach": {"$ref": "items-shared.json#/$defs/itemReach"},
"$$if": {
"modes": ["brew", "ua"],
"value": {
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
}
}
},
"$$ifBrew": {
"fluff": {
"$ref": "items-shared.json#/$defs/fluff"
Expand All @@ -234,21 +247,7 @@
"source",
"page"
],
"$$if": {
"modes": ["site", "ua"],
"value": {
"additionalProperties": false
}
},
"$$ifBrew": {
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
}
}
"additionalProperties": false
},
"excludes": {
"type": "object",
Expand Down Expand Up @@ -282,23 +281,18 @@
},
"net": {
"type": "boolean"
},
"$$if": {
"modes": ["brew", "ua"],
"value": {
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
}
}
}
},
"$$if": {
"modes": ["site", "ua"],
"value": {
"additionalProperties": false
}
},
"$$ifBrew": {
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
}
}
"additionalProperties": false
},
"noDisplay": {
"type": "boolean"
Expand Down Expand Up @@ -326,6 +320,15 @@
},
"hasFluff": {"type": "boolean"},
"hasFluffImages": {"type": "boolean"},
"$$if": {
"modes": ["brew", "ua"],
"value": {
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
}
}
},
"$$ifBrew": {
"fluff": {
"$ref": "items-shared.json#/$defs/fluff"
Expand Down
38 changes: 16 additions & 22 deletions schema/brew-fast/items-base.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "items-base.json",
"version": "1.5.10",
"version": "1.5.11",
"$defs": {
"itemPropertyLookupArray": {
"type": "array",
Expand Down Expand Up @@ -390,6 +390,10 @@
"hasFluffImages": {
"type": "boolean"
},
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
},
"currencyConversion": {
"description": "ID of a value conversion table. Homebrew only.",
"type": "string"
Expand Down Expand Up @@ -425,13 +429,7 @@
"$ref": "items-shared.json#/$defs/fluff"
}
},
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
}
"additionalProperties": false
},
"baseitem": {
"anyOf": [
Expand Down Expand Up @@ -658,6 +656,10 @@
"hasFluffImages": {
"type": "boolean"
},
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
},
"currencyConversion": {
"description": "ID of a value conversion table. Homebrew only.",
"type": "string"
Expand Down Expand Up @@ -693,13 +695,7 @@
"$ref": "items-shared.json#/$defs/fluff"
}
},
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
},
"additionalProperties": false,
"required": [
"name",
"type",
Expand Down Expand Up @@ -930,6 +926,10 @@
"hasFluffImages": {
"type": "boolean"
},
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
},
"currencyConversion": {
"description": "ID of a value conversion table. Homebrew only.",
"type": "string"
Expand Down Expand Up @@ -1031,13 +1031,7 @@
"additionalProperties": false
}
},
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
},
"additionalProperties": false,
"required": [
"_copy"
]
Expand Down
38 changes: 16 additions & 22 deletions schema/brew-fast/items.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "items.json",
"version": "1.14.1",
"version": "1.14.2",
"type": "object",
"$defs": {
"itemData": {
Expand Down Expand Up @@ -546,6 +546,10 @@
"type": "boolean",
"description": "Whether this item has references within its data to dedicated \"itemEntry\"s."
},
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
},
"acSpecial": {
"description": "Free text field for homebrew use.",
"type": "string"
Expand Down Expand Up @@ -589,13 +593,7 @@
"$ref": "items-shared.json#/$defs/fluff"
}
},
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
}
"additionalProperties": false
},
"item": {
"anyOf": [
Expand Down Expand Up @@ -1141,6 +1139,10 @@
"type": "boolean",
"description": "Whether this item has references within its data to dedicated \"itemEntry\"s."
},
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
},
"acSpecial": {
"description": "Free text field for homebrew use.",
"type": "string"
Expand Down Expand Up @@ -1184,13 +1186,7 @@
"$ref": "items-shared.json#/$defs/fluff"
}
},
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
},
"additionalProperties": false,
"required": [
"name",
"rarity",
Expand Down Expand Up @@ -1739,6 +1735,10 @@
"type": "boolean",
"description": "Whether this item has references within its data to dedicated \"itemEntry\"s."
},
"customProperties": {
"description": "An unrestricted area for custom properties to be stored.",
"type": "object"
},
"acSpecial": {
"description": "Free text field for homebrew use.",
"type": "string"
Expand Down Expand Up @@ -1848,13 +1848,7 @@
"additionalProperties": false
}
},
"additionalProperties": {
"type": [
"boolean",
"integer",
"string"
]
},
"additionalProperties": false,
"required": [
"_copy"
]
Expand Down
Loading