Add strict custom field registry

This commit is contained in:
2026-05-07 11:04:11 +08:00
parent 27e71d8c51
commit c1cc9132a4
20 changed files with 582 additions and 20 deletions

View File

@@ -0,0 +1,57 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://gsp.local/schema/gsp.fields.schema.json",
"title": "GSP Fields",
"description": "Game Specification Protocol custom field registry schema.",
"type": "object",
"additionalProperties": true,
"required": ["gspFieldsVersion", "fields"],
"properties": {
"gspFieldsVersion": {
"type": "string",
"enum": ["0.1"]
},
"fields": {
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": true,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"enum": ["string", "number", "integer", "boolean", "array", "object"]
},
"description": {
"type": "string"
},
"allowed": {
"type": "array"
},
"required": {
"type": "boolean"
},
"default": {},
"scope": {
"type": "object",
"additionalProperties": true,
"properties": {
"type": {
"type": "array",
"items": {
"type": "string"
}
},
"idPrefix": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
}