Skip to content

Commit

Permalink
修复了一波schema
Browse files Browse the repository at this point in the history
  • Loading branch information
boybook committed Feb 3, 2024
1 parent 53a9a0b commit c428af9
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 28 deletions.
17 changes: 11 additions & 6 deletions ecnpc/dialogue.handler.schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "对话的handler配置",
"properties": {
"type": {
"type": "string",
"description": "handler类型",
"enum": ["dialogue", "action", "random"]
}
},
"required": ["type"],
"oneOf": [
{
"$ref": "dialogue.schema.json"
Expand All @@ -15,6 +25,7 @@
"callback": {
"oneOf": [
{
"type": "object",
"$ref": "../playeraction/playeraction.schema.json"
},
{
Expand Down Expand Up @@ -58,12 +69,6 @@
},
"required": ["type", "handler"],
"description": "随机进行处理"
},
{
"type": "array",
"items": {
"$ref": "#"
}
}
]
}
14 changes: 13 additions & 1 deletion ecnpc/dialogue.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,19 @@
"description": "点击按钮后是否关闭对话弹窗"
},
"handler": {
"$ref": "dialogue.handler.schema.json"
"oneOf": [
{
"type": "object",
"$ref": "dialogue.handler.schema.json"
},
{
"type": "array",
"items": {
"type": "object",
"$ref": "dialogue.handler.schema.json"
}
}
]
}
},
"required": [
Expand Down
2 changes: 1 addition & 1 deletion ecnpc/prefab.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"skin": {
"description": "指定NPC的皮肤(只有在type为human时生效)",
"oneOf": [
"anyOf": [
{
"type": "string",
"enum": [
Expand Down
27 changes: 7 additions & 20 deletions playeraction/playeraction.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"oneOf": [
{
"type": "object"
},
{
"type": "object",
"properties": {
Expand All @@ -20,8 +17,8 @@
}
},
"required": [
"type",
"id"
"type",
"id"
]
},
{
Expand Down Expand Up @@ -207,7 +204,7 @@
},
"merchandise": {
"type": "string",
"pattern": "^[a-zA-Z0-9]+\\.[a-zA-Z0-9.]+:\\d+$",
"pattern": "^[a-zA-Z0-9-_]+\\.[a-zA-Z0-9-_.]+:\\d+$",
"errorMessage": {
"pattern": "商品ID的格式应为 'xxx.yyy:n',其中 'xxx' 为 category,'yyy' 为 iditem(可包含 '.'),'n' 为数字"
}
Expand All @@ -224,7 +221,7 @@
},
"merchandise": {
"type": "string",
"pattern": "^[a-zA-Z0-9]+\\.[a-zA-Z0-9.]+:\\d+$",
"pattern": "^[a-zA-Z0-9-_]+\\.[a-zA-Z0-9-_.]+:\\d+$",
"errorMessage": {
"pattern": "商品ID的格式应为 'xxx.yyy:n',其中 'xxx' 为 category,'yyy' 为 iditem(可包含 '.'),'n' 为数字"
}
Expand All @@ -241,7 +238,7 @@
},
"merchandise": {
"type": "string",
"pattern": "^[a-zA-Z0-9]+\\.[a-zA-Z0-9.]+:\\d+$",
"pattern": "^[a-zA-Z0-9-_]+\\.[a-zA-Z0-9-_.]+:\\d+$",
"errorMessage": {
"pattern": "商品ID的格式应为 'xxx.yyy:n',其中 'xxx' 为 category,'yyy' 为 iditem(可包含 '.'),'n' 为数字"
}
Expand Down Expand Up @@ -311,12 +308,7 @@
"type": "object",
"properties": {
"type": {
"const": {
"oneOf": [
"firework",
"fireworks"
]
},
"enum": ["firework", "fireworks"],
"description": ""
}
},
Expand Down Expand Up @@ -400,12 +392,7 @@
"type": "object",
"properties": {
"type": {
"const": {
"oneOf": [
"teleport",
"tp"
]
},
"enum": ["teleport", "tp"],
"description": ""
}
},
Expand Down

0 comments on commit c428af9

Please sign in to comment.