Skip to content

Commit 3f5edab

Browse files
jordanpotterJordan Potter
andauthored
Add classes from core and the void (#12)
Co-authored-by: Jordan Potter <me@jordanpotter.com>
1 parent 929166e commit 3f5edab

File tree

7 files changed

+757
-19
lines changed

7 files changed

+757
-19
lines changed

_schemas/classes.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://daggersearch.com/schemas/classes.schema.json",
4+
"type": "array",
5+
"items": { "$ref": "./common/class.schema.json" }
6+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://daggersearch.com/schemas/common/class-name.schema.json",
4+
"type": "string",
5+
"enum": [
6+
"ASSASSIN",
7+
"BARD",
8+
"BRAWLER",
9+
"DRUID",
10+
"GUARDIAN",
11+
"RANGER",
12+
"ROGUE",
13+
"SERAPH",
14+
"SORCERER",
15+
"WARLOCK",
16+
"WARRIOR",
17+
"WITCH",
18+
"WIZARD"
19+
]
20+
}

_schemas/common/class.schema.json

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "https://daggersearch.com/schemas/common/class.schema.json",
4-
"type": "string",
5-
"enum": [
6-
"ASSASSIN",
7-
"BARD",
8-
"BRAWLER",
9-
"DRUID",
10-
"GUARDIAN",
11-
"RANGER",
12-
"ROGUE",
13-
"SERAPH",
14-
"SORCERER",
15-
"WARLOCK",
16-
"WARRIOR",
17-
"WITCH",
18-
"WIZARD"
19-
]
4+
"type": "object",
5+
"properties": {
6+
"id": { "$ref": "./id.schema.json" },
7+
"name": { "$ref": "./class-name.schema.json" },
8+
"description": { "$ref": "./description.schema.json" },
9+
"domains": {
10+
"type": "array",
11+
"items": { "$ref": "./domain.schema.json" },
12+
"minItems": 2,
13+
"maxItems": 2
14+
},
15+
"startingEvasion": { "type": "integer", "minimum": 0 },
16+
"startingHitPoints": { "type": "integer", "minimum": 0 },
17+
"hopeFeature": { "$ref": "./feature.schema.json" },
18+
"classFeatures": {
19+
"type": "array",
20+
"items": { "$ref": "./feature.schema.json" },
21+
"minItems": 1
22+
},
23+
"classItems": {
24+
"type": "array",
25+
"items": { "$ref": "./localized-string.schema.json" },
26+
"minItems": 2,
27+
"maxItems": 2
28+
}
29+
},
30+
"required": [
31+
"id",
32+
"name",
33+
"description",
34+
"domains",
35+
"startingEvasion",
36+
"startingHitPoints",
37+
"hopeFeature",
38+
"classFeatures",
39+
"classItems"
40+
],
41+
"additionalProperties": false
2042
}

_schemas/common/subclass.schema.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
"properties": {
66
"id": { "$ref": "./id.schema.json" },
77
"name": { "$ref": "./localized-string.schema.json" },
8-
"class": { "$ref": "./class.schema.json" },
9-
"domains": { "type": "array", "items": { "$ref": "./domain.schema.json" } },
8+
"class": { "$ref": "./class-name.schema.json" },
9+
"domains": {
10+
"type": "array",
11+
"items": { "$ref": "./domain.schema.json" },
12+
"minItems": 2,
13+
"maxItems": 2
14+
},
1015
"spellcastTrait": { "$ref": "./trait.schema.json" },
1116
"foundation": {
1217
"type": "object",

_scripts/validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cd "$(dirname "$0")"
44

5-
for type in rules ancestries armors communities consumables domain-cards items subclasses weapons; do
5+
for type in ancestries armors classes communities consumables domain-cards items rules subclasses weapons; do
66
for release in core the_void; do
77
npx ajv validate --spec=draft2020 -r "../_schemas/common/**/*.schema.json" -s "../_schemas/${type}.schema.json" -d "../${release}/${type}.json"
88
done

0 commit comments

Comments
 (0)