Files
libretro/schemas/stats.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

42 lines
1.5 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Abdess/retrobios/schemas/stats.schema.json",
"title": "RetroBIOS public statistics",
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "generated_at", "files", "size_bytes", "platforms", "emulators", "systems", "catalog_matched", "source", "downloads", "composition"],
"properties": {
"schema_version": { "const": 1 },
"generated_at": { "type": "string", "format": "date-time" },
"files": { "type": "integer", "minimum": 0 },
"size_bytes": { "type": "integer", "minimum": 0 },
"platforms": { "type": "integer", "minimum": 0 },
"emulators": { "type": "integer", "minimum": 0 },
"systems": { "type": "integer", "minimum": 0 },
"catalog_matched": { "type": "integer", "minimum": 0 },
"source": { "type": "string", "format": "uri" },
"downloads": { "type": "string", "format": "uri" },
"composition": {
"type": "object",
"additionalProperties": false,
"required": ["systems", "arcade", "game_data"],
"properties": {
"systems": { "$ref": "#/$defs/composition" },
"arcade": { "$ref": "#/$defs/composition" },
"game_data": { "$ref": "#/$defs/composition" }
}
}
},
"$defs": {
"composition": {
"type": "object",
"additionalProperties": false,
"required": ["files", "size_bytes"],
"properties": {
"files": { "type": "integer", "minimum": 0 },
"size_bytes": { "type": "integer", "minimum": 0 }
}
}
}
}