mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: add JSON schema for quest
This commit is contained in:
1 parent
52e9a13645
commit
ab63595fba
6 files changed
+393
-8
No files matched your search
@@ -0,0 +1,189 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"instruction": {
|
||||
"type": "string"
|
||||
},
|
||||
"requirements": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": []
|
||||
},
|
||||
"stages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-zA-Z0-9_-]+$"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"requirements": {
|
||||
"$ref": "#/properties/requirements",
|
||||
"default": []
|
||||
},
|
||||
"condition": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"type": "string"
|
||||
},
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"pwd": {
|
||||
"type": "string"
|
||||
},
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"file",
|
||||
"folder"
|
||||
]
|
||||
},
|
||||
"exists": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"path",
|
||||
"type",
|
||||
"exists"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"or": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/properties/stages/items/properties/condition"
|
||||
}
|
||||
},
|
||||
"not": {
|
||||
"$ref": "#/properties/stages/items/properties/condition"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"response": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"narrative",
|
||||
"dialogue"
|
||||
],
|
||||
"default": "narrative"
|
||||
},
|
||||
"content": {
|
||||
"type": "string"
|
||||
},
|
||||
"hint": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"content"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"exceptions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"condition": {
|
||||
"$ref": "#/properties/stages/items/properties/condition"
|
||||
},
|
||||
"response": {
|
||||
"$ref": "#/properties/stages/items/properties/response"
|
||||
},
|
||||
"catchAll": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"condition",
|
||||
"response"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"condition",
|
||||
"response"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"exceptions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/properties/stages/items/properties/exceptions/items/properties/id"
|
||||
},
|
||||
"condition": {
|
||||
"$ref": "#/properties/stages/items/properties/condition"
|
||||
},
|
||||
"response": {
|
||||
"$ref": "#/properties/stages/items/properties/response"
|
||||
},
|
||||
"requirements": {
|
||||
"$ref": "#/properties/requirements",
|
||||
"default": []
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"condition",
|
||||
"response"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"title",
|
||||
"image",
|
||||
"instruction",
|
||||
"stages"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
}
|
||||
Reference in new issue
Block a user