Remove anyOf, because technically it requires matching all subschemas - just redeclare the stats values...

This commit is contained in:
Yair Morgenstern
2023-09-21 23:34:24 +03:00
parent 5dbdf630ab
commit cb27d13723

View File

@ -1,86 +1,86 @@
{ {
"$schema": "http://json-schema.org/draft-07/schema", "$schema": "http://json-schema.org/draft-07/schema",
"type": "array", "type": "array",
"items": { "items": {
"allOf": [ "type": "object",
{ "$ref": "#/definitions/stats"}, "properties": {
{ "name": { "type": "string" },
"type": "object",
"properties": { "production": { "type": "number" },
"name": { "type": "string" }, "food": { "type": "number" },
"uniques": { "gold": { "type": "number" },
"type": "array", "science": { "type": "number" },
"items": { "culture": { "type": "number" },
"type": "string", "happiness": { "type": "number" },
"pattern": "^[^><]*(\\<[^>]*\\>[^><]*)*$" "faith": { "type": "number" },
},
"uniqueItems": true // Can't imagine you mean to include the same thing twice "uniques": {
}, "type": "array",
"civilopediaText": { "items": { "type": "string" }
"type": "array", },
"items": { "$ref": "#/definitions/civilopediaText"} "civilopediaText": {
}, "type": "array",
"requiredTech": { "type": "string" }, "items": { "$ref": "#/definitions/civilopediaText"}
"cost": { "type": "number" }, },
"maintenance": { "type": "number" }, "requiredTech": { "type": "string" },
"percentStatBonus": { "$ref": "#/definitions/stats" }, "cost": { "type": "number" },
"specialistSlots": { "type": "object" }, "maintenance": { "type": "number" },
"greatPersonPoints": { "type": "object" }, "percentStatBonus": { "$ref": "#/definitions/stats" },
"hurryCostModifier": { "type": "number" }, "specialistSlots": { "type": "object" },
"isWonder": { "type": "boolean" }, "greatPersonPoints": { "type": "object" },
"isNationalWonder": { "type": "boolean" }, "hurryCostModifier": { "type": "number" },
"requiredBuilding": { "type": "string" }, "isWonder": { "type": "boolean" },
"requiredResource": { "type": "string" }, "isNationalWonder": { "type": "boolean" },
"requiredNearbyImprovedResources": { "requiredBuilding": { "type": "string" },
"type": "array", "requiredResource": { "type": "string" },
"items": { "type": "string" } "requiredNearbyImprovedResources": {
}, "type": "array",
"cityStrength": { "type": "number" }, "items": { "type": "string" }
"cityHealth": { "type": "number" }, },
"replaces": { "type": "string" }, "cityStrength": { "type": "number" },
"uniqueTo": { "type": "string" }, "cityHealth": { "type": "number" },
"quote": { "type": "string" }, "replaces": { "type": "string" },
"replacementTextForUniques": { "type": "string" } "uniqueTo": { "type": "string" },
}, "quote": { "type": "string" },
"required": [ "replacementTextForUniques": { "type": "string" }
"name" },
], "required": [
"additionalProperties": false "name"
} ],
] "additionalProperties": false
}, },
"definitions": { "definitions": {
"stats": { "stats": {
"type": "object", "type": "object",
"properties": { "properties": {
"production": { "type": "number" }, "production": { "type": "number" },
"food": { "type": "number" }, "food": { "type": "number" },
"gold": { "type": "number" }, "gold": { "type": "number" },
"science": { "type": "number" }, "science": { "type": "number" },
"culture": { "type": "number" }, "culture": { "type": "number" },
"happiness": { "type": "number" }, "happiness": { "type": "number" },
"faith": { "type": "number" } "faith": { "type": "number" }
}, },
"additionalProperties": false "additionalProperties": false
}, },
"civilopediaText": { "civilopediaText": {
"type": "object", "type": "object",
"properties": { "properties": {
"text": { "type": "string" }, "text": { "type": "string" },
"link": { "type": "string" }, "link": { "type": "string" },
"icon": { "type": "string" }, "icon": { "type": "string" },
"extraImage": { "type": "string" }, "extraImage": { "type": "string" },
"imageSize": { "type": "number" }, "imageSize": { "type": "number" },
"size": { "type": "number" }, "size": { "type": "number" },
"header": { "type": "number" }, "header": { "type": "number" },
"indent": { "type": "number" }, "indent": { "type": "number" },
"padding": { "type": "number" }, "padding": { "type": "number" },
"color": { "type": "string" }, "color": { "type": "string" },
"separator": { "type": "boolean" }, "separator": { "type": "boolean" },
"starred": { "type": "boolean" }, "starred": { "type": "boolean" },
"centered": { "type": "boolean" }, "centered": { "type": "boolean" },
"iconCrossed": { "type": "boolean" } "iconCrossed": { "type": "boolean" }
} }
} }
} }
} }