diff --git a/game-schema-d4.json b/game-schema-d4.json index ed407bd4..1c6f8095 100644 --- a/game-schema-d4.json +++ b/game-schema-d4.json @@ -1,25 +1,39 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/gbdev/database/master/game-schema-d3.json", - "title": "Game object", - "description": "A game in the Homebrew Hub database", + "$id": "https://raw.githubusercontent.com/gbdev/database/master/game-schema-d4.json", + "title": "Game manifest", + "description": "Describes a software entry in the Homebrew Hub database, mentioning metadata and related assets (such as ROM files).", "type": "object", + "additionalProperties": false, "properties": { "slug": { - "description": "A unique string identifier for a game", - "type": "string" + "description": "A unique string identifier for a game. Letters, numbers, the 'en' dash and the dot are the only allowed characters.", + "type": "string", + "pattern": "^[A-Za-z0-9]+(?:-[A-Za-z0-9.]+)*$" }, "developer": { - "type": "string", - "description": "A name, username or nickname representing the developer(s)" + "description": "A name, username or nickname representing the developer(s)", + "anyof": + [ + { + "type": "array", + "items": + { + "type": "string" + } + }, + { + "type": "string" + } + ] }, "description": { "type": "string", - "description": "A text description about the entry (e.g. Instructions, lore, ..)" + "description": "A brief, plain text description about the entry" }, "title": { @@ -30,13 +44,25 @@ { "type": "string", "description": "Target console", - "enum": ["GB", "GBC", "GBA"] + "enum": + [ + "GB", + "GBC", + "GBA" + ] }, "typetag": { "type": "string", "description": "Type of the software", - "enum": ["game", "homebrew", "demo", "hackrom", "music"] + "enum": + [ + "game", + "tool", + "demo", + "hackrom", + "music" + ] }, "gameLicense": { @@ -59,6 +85,21 @@ "format": "date", "description": "The date the entry was first released" }, + "features": + { + "type": "array", + "description": "A list of the addional supported features", + "items": + { + "type": "string", + "enum": + [ + "gbprinter", + "gbcamera", + "sgb" + ] + } + }, "tags": { "type": "array", @@ -66,7 +107,18 @@ "items": { "type": "string", - "enum": ["RPG", "Open Source", "Adventure", "Action", "Puzzle", "Platform", "gbajam21", "gbcompo21", "gbcompo21-shortlist", "gbprinter"] + "enum": + [ + "RPG", + "Open Source", + "Adventure", + "Action", + "Puzzle", + "Platform", + "gbajam21", + "gbcompo21", + "gbcompo21-shortlist" + ] } }, "alias": @@ -128,9 +180,11 @@ "$ref": "#/definitions/file" } } - }, - "required": ["slug"], + "required": + [ + "slug" + ], "definitions": { "file": @@ -146,9 +200,20 @@ { "type": "string" }, - "type": { + "type": + { + "type": "string", + "enum": + [ + "rom", + "manual", + "release" + ] + }, + "version": + { "type": "string", - "enum": ["rom", "manual", "release"] + "description": "Specify game version this file refers to. More files can be grouped under the same version" }, "playable": { @@ -178,14 +243,46 @@ { "type": "boolean", "description": "Describes if the file is the default ROM to play" + }, + "baserom": + { + "type": "object", + "description": "Base ROM required for the patch to be applied", + "properties": + { + "filename": + { + "type": "string" + }, + "md5": + { + "type": "string" + }, + "sha1": + { + "type": "string" + }, + "sha256": + { + "type": "string" + }, + "crc32": + { + "type": "string" + } + } } }, - "required": ["filename"] + "required": + [ + "filename" + ] }, "license": { "type": "string", - "enum": [ + "enum": + [ "0BSD", "AAL", "Abstyles", @@ -540,7 +637,6 @@ "ZPL-2.0", "ZPL-2.1" ] - } } }