JSON Schema 2020-12
Localization Matrix
Locales and required audio/subtitle outputs.
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sharprod.com/schemas/localization-matrix.schema.json",
"title": "SHAR Production Localization Matrix Contract",
"type": "object",
"additionalProperties": false,
"properties": {
"master_id": {
"type": "string"
},
"locales": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"tag",
"audio",
"subtitles"
],
"properties": {
"tag": {
"type": "string",
"pattern": "^[a-z]{2}(?:-[A-Z]{2})?$"
},
"audio": {
"type": "boolean"
},
"subtitles": {
"type": "boolean"
}
}
}
}
},
"required": [
"master_id",
"locales"
]
}Verified example
{
"input": {
"master_id": "master-synthetic",
"locales": [
{
"tag": "ru-RU",
"audio": true,
"subtitles": true
}
]
},
"result": {
"valid": true,
"errors": []
}
}Rejected example
{
"input": {
"master_id": "master-synthetic",
"locales": [
{
"tag": "russian",
"audio": true,
"subtitles": true
}
]
},
"result": {
"valid": false,
"errors": [
{
"instancePath": "/locales/0/tag",
"schemaPath": "#/properties/locales/items/properties/tag/pattern",
"keyword": "pattern",
"params": {
"pattern": "^[a-z]{2}(?:-[A-Z]{2})?$"
},
"message": "must match pattern \"^[a-z]{2}(?:-[A-Z]{2})?$\""
}
]
}
}