Files
libretro/schemas/install-manifest.schema.json
T
Abdessamad Derraz 5d417c8229 feat: add data contract validation
JSON Schemas for the database, install and pack manifests, target
manifests, site API envelopes and stats, plus the semantic invariants a
schema cannot express: declared totals matching their lists, no
destination both installed and omitted, database keys matching their
sha1. validate_site.py checks the rendered HTML for metadata, headings,
image alternatives, duplicate ids and unresolved local links.

Pack manifests are read from inside the generated archives, where
generate_pack writes them, rather than from a dist/ glob that matches
nothing.

Emulator and platform schemas gain additionalProperties: false, and
cores[] plus contents[].name must be strings: an unquoted 81 or 01 in
YAML parses as a number and stops matching the upstream name.
2026-08-10 13:35:33 +02:00

75 lines
3.1 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Abdess/retrobios/schemas/install-manifest.schema.json",
"title": "RetroBIOS installer manifest",
"type": "object",
"additionalProperties": false,
"required": ["manifest_version", "source", "regions", "platform", "display_name", "version", "generated", "base_destination", "detect", "standalone_copies", "total_files", "total_size", "total_omitted", "omitted_files", "files"],
"properties": {
"manifest_version": { "const": 2 },
"source": { "enum": ["full", "platform", "truth"] },
"regions": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
"platform": { "type": "string", "minLength": 1 },
"display_name": { "type": "string", "minLength": 1 },
"version": { "type": "string" },
"generated": { "type": "string", "format": "date-time" },
"base_destination": { "type": "string" },
"detect": { "type": "array", "items": { "type": "object" } },
"standalone_copies": { "type": "array", "items": { "type": "object" } },
"total_files": { "type": "integer", "minimum": 0 },
"total_size": { "type": "integer", "minimum": 0 },
"total_omitted": { "type": "integer", "minimum": 0 },
"omitted_files": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["dest", "name", "system", "required", "reason", "cores"],
"properties": {
"dest": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$" },
"name": { "type": "string", "minLength": 1 },
"system": { "type": "string" },
"required": { "type": "boolean" },
"reason": { "enum": ["hash_mismatch", "not_found", "external", "user_provided"] },
"cores": {
"oneOf": [
{ "type": "null" },
{ "type": "array", "items": { "type": "string" }, "uniqueItems": true }
]
}
}
}
},
"files": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["dest", "sha1", "sha256", "size", "repo_path", "cores"],
"properties": {
"dest": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$" },
"sha1": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
"sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
"size": { "type": "integer", "minimum": 0 },
"repo_path": { "type": "string" },
"cores": {
"oneOf": [
{ "type": "null" },
{ "type": "array", "items": { "type": "string" }, "uniqueItems": true }
]
},
"storage": { "const": "release" },
"release_asset": { "type": "string", "pattern": "^[^/\\\\]+$" }
},
"oneOf": [
{ "required": ["release_asset"] },
{
"properties": { "repo_path": { "type": "string", "pattern": "^bios/" } },
"not": { "required": ["release_asset"] }
}
]
}
}
}
}