Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit b5481ea

Browse files
committed
chore: update JSON schema and test files to use object structure
1 parent a3fe957 commit b5481ea

3 files changed

Lines changed: 44 additions & 58 deletions

File tree

LunarDialogueSchema.json

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "https://lunar.bliaik.com/LunarDialogueSchema.json",
4-
"type": "array",
5-
"items": {
6-
"type": "object",
7-
"properties": {
8-
"text": {
9-
"type": "string"
10-
},
11-
"config": {
12-
"type": "array",
13-
"items": {
14-
"type": "object",
15-
"properties": {
16-
"index": {
17-
"type": "integer"
4+
"type": "object",
5+
"patternProperties": {
6+
"^.*$": {
7+
"type": "object",
8+
"properties": {
9+
"text": {
10+
"type": "string"
11+
},
12+
"config": {
13+
"type": "array",
14+
"items": {
15+
"type": "object",
16+
"properties": {
17+
"index": {
18+
"type": "integer"
19+
},
20+
"event": {
21+
"type": "string"
22+
}
1823
},
19-
"event": {
20-
"type": "string"
21-
}
22-
},
23-
"required": [
24-
"index",
25-
"event"
26-
],
27-
"additionalProperties": false
24+
"required": [
25+
"index",
26+
"event"
27+
],
28+
"additionalProperties": false
29+
}
2830
}
29-
}
30-
},
31-
"required": [
32-
"text"
33-
],
34-
"additionalProperties": false
35-
}
31+
},
32+
"required": [
33+
"text"
34+
],
35+
"additionalProperties": false
36+
}
37+
},
38+
"additionalProperties": false
3639
}

Test.json

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[
2-
{
1+
{
2+
"Text1": {
33
"text": "This is a Text",
44
"config": [
55
{
@@ -16,20 +16,7 @@
1616
}
1717
]
1818
},
19-
{
20-
"text": "This is a Text",
21-
"config": [
22-
{
23-
"index": 1,
24-
"event": "SetSound_click"
25-
},
26-
{
27-
"index": 2,
28-
"event": "SetAnimation_jump"
29-
}
30-
]
31-
},
32-
{
19+
"Text3": {
3320
"text": "This is a Text"
3421
}
35-
]
22+
}

Test.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
- text: This is a Text
1+
Text1:
2+
text: This is a Text
23
config:
34
- index: 0
45
event: SetSound_default
@@ -7,18 +8,13 @@
78
- index: 3
89
event: SetColor_red
910

10-
- text: This is a Text
11+
Text2:
12+
text: This is a Text
1113
config:
1214
- index: 1
1315
event: SetSound_click
1416
- index: 2
1517
event: SetAnimation_jump
16-
17-
- text: This is a Text
18-
config:
19-
- index: 1
20-
event: SetSound_alert
21-
- index: 2
22-
event: SetAnimation_run
23-
- index: 3
24-
event: SetColor_blue
18+
19+
Text3:
20+
text: This is a Text

0 commit comments

Comments
 (0)