Skip to content

Commit d6accd3

Browse files
jordanpotterJordan Potter
andauthored
Refactor lists in descriptions (#9)
Co-authored-by: Jordan Potter <me@jordanpotter.com>
1 parent 74dc3c5 commit d6accd3

14 files changed

+1247
-2096
lines changed

_schemas/common/ancestry.schema.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"properties": {
66
"id": { "$ref": "./id.schema.json" },
77
"name": { "$ref": "./localized-string.schema.json" },
8-
"description": { "$ref": "./localized-string.schema.json" },
8+
"description": { "$ref": "./description.schema.json" },
99
"features": {
1010
"type": "array",
11-
"items": { "$ref": "./feature.schema.json" }
11+
"items": { "$ref": "./feature.schema.json" },
12+
"minItems": 1
1213
}
1314
},
1415
"required": ["id", "name", "description", "features"],

_schemas/common/community.schema.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
"properties": {
66
"id": { "$ref": "./id.schema.json" },
77
"name": { "$ref": "./localized-string.schema.json" },
8-
"description": { "$ref": "./localized-string.schema.json" },
8+
"description": { "$ref": "./description.schema.json" },
99
"personalities": {
1010
"type": "array",
1111
"items": { "$ref": "./localized-string.schema.json" }
1212
},
1313
"features": {
1414
"type": "array",
15-
"items": { "$ref": "./feature.schema.json" }
15+
"items": { "$ref": "./feature.schema.json" },
16+
"minItems": 1
1617
}
1718
},
1819
"required": ["id", "name", "description", "personalities", "features"],

_schemas/common/description.schema.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55
"items": {
66
"type": "object",
77
"properties": {
8-
"type": { "type": "string", "enum": ["PARAGRAPH", "LIST_ITEM"] },
9-
"text": { "$ref": "./localized-string.schema.json" }
8+
"paragraph": { "$ref": "./localized-string.schema.json" },
9+
"list": {
10+
"type": "array",
11+
"items": { "$ref": "./localized-string.schema.json" },
12+
"minItems": 1
13+
}
1014
},
11-
"required": ["type", "text"],
12-
"additionalProperties": false
13-
}
15+
"additionalProperties": false,
16+
"oneOf": [{ "required": ["paragraph"] }, { "required": ["list"] }],
17+
"not": { "required": ["paragraph", "list"] }
18+
},
19+
"minItems": 1
1420
}

_schemas/common/domain-card.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"recallCost": { "type": "integer", "minimum": 0 },
1212
"features": {
1313
"type": "array",
14-
"items": { "$ref": "./feature.schema.json" }
14+
"items": { "$ref": "./feature.schema.json" },
15+
"minItems": 1
1516
}
1617
},
1718
"required": [

_schemas/common/subclass.schema.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"properties": {
1414
"features": {
1515
"type": "array",
16-
"items": { "$ref": "./feature.schema.json" }
16+
"items": { "$ref": "./feature.schema.json" },
17+
"minItems": 1
1718
}
1819
},
1920
"required": ["features"],
@@ -24,7 +25,8 @@
2425
"properties": {
2526
"features": {
2627
"type": "array",
27-
"items": { "$ref": "./feature.schema.json" }
28+
"items": { "$ref": "./feature.schema.json" },
29+
"minItems": 1
2830
}
2931
},
3032
"required": ["features"],
@@ -35,7 +37,8 @@
3537
"properties": {
3638
"features": {
3739
"type": "array",
38-
"items": { "$ref": "./feature.schema.json" }
40+
"items": { "$ref": "./feature.schema.json" },
41+
"minItems": 1
3942
}
4043
},
4144
"required": ["features"],

core/ancestries.json

Lines changed: 164 additions & 126 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)