{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id":"https://www.github.com/unexpectedpanda/retool",
    "title": "Clone list specification. For a how to create clone lists, see https://unexpectedpanda.github.io/retool/contribute-clone-lists/.",
    "description": "2025-11-24 21:53",
    "$comment": "Clone list requires both a `description` and `variants` key, and accepts no other keys.",
    "type": "object",
    "required": ["description", "variants"],
    "additionalProperties": false,
    "properties": {
        "description": {
            "description": "The header block of the clone list.",
            "type": "object",
            "$comment": "The `description` value must be an object. It requires `name`, `lastUpdated`, and `minimumVersion` keys.",
            "required": ["name", "lastUpdated", "minimumVersion"],
            "additionalProperties": false,
            "properties": {
                "name": {
                    "description": "The system name and release group of the DAT file the clone list is related to.",
                    "$comment": "The `name` key is required. The value must be a string, and it can't be empty. It should match a No-Intro or Redump system name, and should end with the release group (either `(No-Intro)` or `(Redump)`).",
                    "$ref": "#/$defs/nonEmptyString",
                    "pattern": "^.+ \\((?:No-Intro|Redump)\\)$"
                },
                "lastUpdated": {
                    "description": "The last time the clone list was updated.",
                    "$comment": "The `lastUpdated` key is required. Its value must be in extended ISO 8601 format. For example, `YYYY-MM-DD hh:mm:ss` or `YYY-MM-DD hh:mm`.",
                    "$ref": "#/$defs/nonEmptyString",
                    "pattern": "^[2-9][0-9]{3,3}-(?:(?:0[469]|11)-(?:0[1-9]|1[0-9]|2[0-9]|30)|02-(?:0[1-9]|1[0-9]|2[0-9])|(?:0[13578]|10|12)-(?:0[1-9]|1[0-9]|2[0-9]|3[01])) (?:0[0-9]|1[0-9]|2[0-3]):(?:[0-5][0-9]:?){1,2}(?<!:)$"
                },
                "minimumVersion": {
                    "description": "The minimum version of Retool required to understand all of the features used in the clone list. The minimumVersion key is the only data in the description used by Retool, the rest is to make parsing and updating the clone list easier for humans.",
                    "$comment": "The `minimumVersion` key is required. Its value must be a string that follows semantic versioning syntax.",
                    "$ref": "#/$defs/nonEmptyString",
                    "pattern": "^[0-9]\\.[0-9\\.]{1,4}$"
                }
            }
        },
        "variants": {
            "description": "When Retool doesn't automatically detect titles that are related to each other, you can manually group them together in the variants array. The variants array can also be used to set certain properties on titles that aid with filtering.",
            "$comment": "The `variants` value must be an array. It must contain at least one object.",
            "type": "array",
            "minItems": 1,
            "items": {
                "$comment": "Each entity in the `variants` array must be an object. An object in the `variants` array requires a `group` key, and additionally can include any of the following keys: `titles`, `supersets`, or `compilations`.",
                "type": "object",
                "allOf": [
                    {
                        "$comment": "Missing a `group` key.",
                        "required": ["group"]
                    },
                    {
                        "$comment": "Missing a `titles`, `superset`, or `compilations` key.",
                        "anyOf": [
                            {
                                "required": ["titles"]
                            },
                            {
                                "required": ["supersets"]
                            },
                            {
                                "required": ["compilations"]
                            }
                        ]
                    }
                ],
                "additionalProperties": false,
                "properties": {
                    "group": {
                        "description": "The group value is used as the new group name and short name for all of the titles in the object.",
                        "$comment": "The `group` value must be a non-empty string.",
                        "$ref": "#/$defs/nonEmptyString"
                    },
                    "categories": {
                        "description": "Optional. A category is a class of titles, like Demos, Games, and Multimedia. Multiple categories can be assigned to a title, and existing categories are overridden. If assigned at this level, all titles, supersets, and compilations in the object inherit the listed categories.",
                        "$comment": "The `categories` value must be an array. It must contain at least one non-empty string.",
                        "type": "array",
                        "minItems": 1,
                        "contains": {
                            "$ref": "#/$defs/nonEmptyString"
                        }
                    },
                    "titles": {
                        "description": "Optional. Contains singular, standard titles that belong to a group.",
                        "$comment": "The `titles` value must be an array. It must contain at least one object with a `searchTerm` property.",
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "$comment": "Each entity in the `titles` array must be an object. You can use the following keys in a `titles` object:\n\n* `searchTerm` (required)\n\n* `categories`\n\n* `englishFriendly`\n\n* `filters`\n\n* `isOldest`\n\n* `localNames`\n\n* `nameType`\n\n* `priority`",
                            "type": "object",
                            "minProperties": 1,
                            "required": ["searchTerm"],
                            "additionalProperties": false,
                            "properties": {
                                "searchTerm": {
                                    "description": "The search term used when looking for a title in an input DAT file.",
                                    "$comment": "The `searchTerm` value must be a non-empty string.",
                                    "$ref": "#/$defs/nonEmptyString"
                                },
                                "categories": {
                                    "description": "Optional. A category is a class of titles, like Demos, Games, and Multimedia. Multiple categories can be assigned to a title, and existing categories are overridden.",
                                    "$comment": "The `categories` value must be an array. It must contain at least one non-empty string.",
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                        "$ref": "#/$defs/nonEmptyString"
                                    }
                                },
                                "englishFriendly": {
                                    "description": "Optional, defaults to false. An English-friendly title is one that hasn't been marked as supporting English, but an English-speaking player can easily play to completion.",
                                    "$comment": "The `englishFriendly` value must be a boolean.",
                                    "type": "boolean"
                                },
                                "filters": {
                                    "description": "Optional. Treat some titles found by a search term differently based on conditions. If all conditions are true, then Retool executes the results.",
                                    "$comment": "The `filters` value must be an array. It must contain at least one object, which contains `conditions` and `results` properties.",
                                    "$ref": "#/$defs/filters"
                                },
                                "isOldest": {
                                    "description": "Optional, defaults to false. When a user selects Prefer oldest production versions instead of newest, this can be used to manually override Retool's automatic choice, or override priority settings in clone lists.",
                                    "$comment": "The `isOldest` value must be a boolean.",
                                    "type": "boolean"
                                },
                                "localNames": {
                                    "description": "Optional. Contains the local names of a title. Add names for all available languages, including English.",
                                    "$comment": "The `localNames` value must be an object. It must contain at least one key/value pair, where the key is a valid language. Add all available languages, including English.",
                                    "type": "object",
                                    "$ref": "#/$defs/languages"
                                },
                                "nameType": {
                                    "description": "Optional. What name type the search term is, so Retool can match it accurately against names in the input DAT file.",
                                    "$comment": "The value of `nameType` must be `short`, `full`, `regionFree`, or `regex`.",
                                    "$ref": "#/$defs/nameType"
                                },
                                "priority": {
                                    "description": "Optional, defaults to 1. Lower numbers are considered higher priority, with 1 the highest priority. Typically, a title with a higher priority wins when Retool is choosing a 1G1R title.",
                                    "$comment": "The `priority` value must be an integer greater than 1. Higher numbers are lower priority. For priorities of `1`, remove the `priority` property, as `1` is the default.",
                                    "type": "integer",
                                    "minimum": 2
                                }

                            }
                        }
                    },
                    "supersets": {
                        "description": "Optional. Contains singular titles that contain more content, or for some reason are superior to standard versions. This might include, for example, a game of the year edition, an all-in-one pack that bundles a game and all its DLC, or a DVD version of a title that was previously released on multiple CDs.",
                        "$comment": "The `supersets` value must be an array. It must contain at least one object with a `searchTerm` property.",
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "type": "object",
                            "minProperties": 1,
                            "required": ["searchTerm"],
                            "additionalProperties": false,
                            "properties": {
                                "searchTerm": {
                                    "description": "The search term used when looking for a title in an input DAT file.",
                                    "$comment": "The `searchTerm` value must be a non-empty string.",
                                    "$ref": "#/$defs/nonEmptyString"
                                },
                                "nameType": {
                                    "description": "Optional. What name type the search term is, so Retool can match it accurately against names in the input DAT file.",
                                    "$comment": "The value of `nameType` must be `short`, `full`, `regionFree`, or `regex`.",
                                    "$ref": "#/$defs/nameType"
                                },
                                "priority": {
                                    "description": "Optional, defaults to 1. Lower numbers are considered higher priority, with 1 the highest priority. Typically, a title with a higher priority wins when Retool is choosing a 1G1R title.",
                                    "$comment": "The `priority` value must be an integer greater than 1. Higher numbers are lower priority. For priorities of `1`, remove the `priority` property, as `1` is the default.",
                                    "type": "integer",
                                    "minimum": 2
                                },
                                "categories": {
                                    "description": "Optional. A category is a class of titles, like Demos, Games, and Multimedia. Multiple categories can be assigned to a title, and existing categories are overridden.",
                                    "$comment": "The `categories` value must be an array. It must contain at least one non-empty string.",
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                        "$ref": "#/$defs/nonEmptyString"
                                    }
                                },
                                "englishFriendly": {
                                    "description": "Optional, defaults to false. An English-friendly title is one that hasn't been marked as supporting English, but an English-speaking player can easily play to completion.",
                                    "$comment": "The `englishFriendly` value must be a boolean.",
                                    "type": "boolean"
                                },
                                "isOldest": {
                                    "description": "Optional, defaults to false. When a user selects Prefer oldest production versions instead of newest, this can be used to manually override Retool's automatic choice, or override priority settings in clone lists.",
                                    "$comment": "The `isOldest` value must be a boolean.",
                                    "type": "boolean"
                                },
                                "localNames": {
                                    "description": "Optional. Contains the local names of a title. Add names for all available languages, including English.",
                                    "$comment": "The `localNames` value must be an object. It must contain at least one key/value pair, where the key is a valid language. Add all available languages, including English.",
                                    "type": "object",
                                    "$ref": "#/$defs/languages"
                                },
                                "filters": {
                                    "description": "Optional. Treat some titles found by a search term differently based on conditions. If all conditions are true, then Retool executes the results.",
                                    "$comment": "The `filters` value must be an array. It must contain at least one object, which contains `conditions` and `results` properties.",
                                    "$ref": "#/$defs/filters"
                                }
                            }
                        }
                    },
                    "compilations": {
                        "description": "Optional. Contains titles that in themselves contain multiple titles. They might be from the same series of games, a single publisher, from a single genre, or otherwise.",
                        "$comment": "The `compilations` value must be an array. It must contain at least one object with a `searchTerm` property.",
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "type": "object",
                            "minProperties": 1,
                            "required": ["searchTerm"],
                            "additionalProperties": false,
                            "properties": {
                                "searchTerm": {
                                    "description": "The search term used when looking for a title in an input DAT file.",
                                    "$comment": "The `searchTerm` value must be a non-empty string.",
                                    "$ref": "#/$defs/nonEmptyString"
                                },
                                "nameType": {
                                    "description": "Optional. What name type the search term is, so Retool can match it accurately against names in the input DAT file.",
                                    "$comment": "The value of `nameType` must be `short`, `full`, `regionFree`, or `regex`.",
                                    "$ref": "#/$defs/nameType"
                                },
                                "priority": {
                                    "description": "Optional, defaults to 1. Lower numbers are considered higher priority, with 1 the highest priority. Typically, a title with a higher priority wins when Retool is choosing a 1G1R title.",
                                    "$comment": "The `priority` value must be an integer greater than 1. Higher numbers are lower priority. For priorities of `1`, remove the `priority` property, as `1` is the default.",
                                    "type": "integer",
                                    "minimum": 1
                                },
                                "categories": {
                                    "description": "Optional. A category is a class of titles, like Demos, Games, and Multimedia. Multiple categories can be assigned to a title, and existing categories are overridden.",
                                    "$comment": "The `categories` value must be an array. It must contain at least one non-empty string.",
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                        "$ref": "#/$defs/nonEmptyString"
                                    }
                                },
                                "titlePosition": {
                                    "description": "See https://unexpectedpanda.github.io/retool/contribute-clone-lists-variants-compilations/ for details.",
                                    "$comment": "The `titlePosition` value must be an integer.",
                                    "type": "integer"
                                },
                                "localNames": {
                                    "description": "Optional. Contains the local names of a title. Add names for all available languages, including English.",
                                    "$comment": "The `localNames` value must be an object. It must contain at least one key/value pair, where the key is a valid language. Add all available languages, including English.",
                                    "type": "object",
                                    "$ref": "#/$defs/languages"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "$defs": {
        "nonEmptyString": {
            "type": "string",
            "minLength": 1,
            "not": {
                "anyOf": [
                    {
                        "pattern": "^\\s+$"
                    },
                    {
                        "pattern": "^\\s+.*$"
                    },
                    {
                        "pattern": "\\s+$"
                    },
                    {
                        "pattern": ".+,$"
                    }
                ]
            }
        },
         "categories": {
            "enum": [
                "Add-Ons",
                "Aftermarket",
                "Applications",
                "Audio",
                "BIOS",
                "Bonus Discs",
                "Coverdiscs",
                "Demos",
                "Educational",
                "Games",
                "Manuals",
                "Multimedia",
                "Pirate",
                "Preproduction",
                "Promotional",
                "Unlicensed",
                "Video"
            ]
        },
        "filters": {
            "type": "array",
            "minItems": 1,
            "items": {
                "$comment": "Each entity in the `filters` array must be an object. An object in the `filters` array needs both `conditions` and results` properties.",
                "type": "object",
                "minProperties": 2,
                "maxProperties": 2,
                "additionalProperties": false,
                "required": ["conditions", "results"],
                "properties": {
                    "conditions": {
                        "$comment": "The `conditions` value must be an object, and must contain at least one of the following properties: `matchLanguages`, `matchRegions`, `matchString`, `regionOrder`.",
                        "type": "object",
                        "minProperties": 1,
                        "additionalProperties": false,
                        "properties": {
                            "matchLanguages": {
                                "description": "Optional. A list of languages using ISO-639-1 two-letter language codes, that a title must match for the condition to be true.",
                                "$comment": "The `matchLanguages` value must be an array, and must contain at least one ISO-639-1 two-letter language code.",
                                "type": "array",
                                "items": {
                                    "$ref": "#/$defs/nonEmptyString"
                                }
                            },
                            "matchRegions": {
                                "description": "Optional. A list of regions that a title must match for the condition to be true.",
                                "$comment": "The `matchRegions` value must be an array, and must contain at least one region.",
                                "type": "array",
                                "minItems": 1,
                                "items": {
                                    "$ref": "#/$defs/regions"
                                }
                            },
                            "matchString": {
                                "description": "Optional. A regex string that must match against the title's full name for the condition to be true.",
                                "$comment": "The `matchString` value must be a valid, non-empty regex string.",
                                "$ref": "#/$defs/nonEmptyString"
                            },
                            "regionOrder": {
                                "description": "Optional. A list of regions that must be higher than others in the user's region priority for the condition to be true. If any of the regions in the higherRegions array is higher in the user region order than all of the regions in the lowerRegions array, then the condition is true.",
                                "$comment": "The `regionOrder` value must be an array, and must contain `higherRegions` and `lowerRegions` properties.",
                                "type": "object",
                                "minProperties": 2,
                                "required": ["higherRegions", "lowerRegions"],
                                "properties": {
                                    "higherRegions": {
                                        "$comment": "The `higherRegions` value must be an array, and must contain at least one region.",
                                        "type": "array",
                                        "minItems": 1,
                                        "items": {
                                            "$ref": "#/$defs/regions"
                                        }
                                    },
                                    "lowerRegions": {
                                        "$comment": "The `lowerRegions` value must be an array, and must contain at least one region.",
                                        "type": "array",
                                        "minItems": 1,
                                        "items": {
                                            "$ref": "#/$defs/regions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "results": {
                        "$comment": "The `results` value must be an object, and must contain at least one of the following properties: `categories`, `englishFriendly`, `group`, `isOldest`, `superset`, `localNames`, `priority`.",
                        "type": "object",
                        "minProperties": 1,
                        "additionalProperties": false,
                        "properties": {
                            "categories": {
                                "description": "Optional. A category is a class of titles, like Demos, Games, and Multimedia. Multiple categories can be assigned to a title, and existing categories are overridden.",
                                "$comment": "The `categories` value must be an array. It must contains at least one non-empty string.",
                                "type": "array",
                                "minitems": 1,
                                "items": {
                                    "$ref": "#/$defs/categories"
                                }
                            },
                            "englishFriendly": {
                                "description": "Optional, defaults to false. An English-friendly title is one that hasn't been marked as supporting English, but an English-speaking player can easily play to completion.",
                                "$comment": "The `englishFriendly` value must be a boolean.",
                                "type": "boolean"
                            },
                            "group": {
                                "description": "Optional. The group value is used as the new group name and short name for all the titles that match the filter.",
                                "$comment": "The `group` value must be a non-empty string.",
                                "$ref": "#/$defs/nonEmptyString"
                            },
                            "isOldest": {
                                "description": "Optional, defaults to false. When a user selects Prefer oldest production versions instead of newest, this can be used to manually override Retool's automatic choice, or override priority settings in clone lists.",
                                "$comment": "The `isOldest` value must be a boolean.",
                                "type": "boolean"
                            },
                            "superset": {
                                "description": "Optional. Designates the title as a superset. Supersets are variants of titles that contain more content, or for some reason are superior to another version. This might include, for example, a Game of the Year edition, an all-in-one pack that bundles a game and all its DLC, or a DVD version of a title previously released on multiple CDs.",
                                "$comment": "The `superset` value must be a boolean.",
                                "type": "boolean"
                            },
                            "localNames": {
                                "description": "Optional. Contains the local names of a title. Add names for all available languages, including English.",
                                "$comment": "The `localNames` value must be an object. It must contain at least one key/value pair, where the key is a valid language. Add all available languages, including English.",
                                "type": "object",
                                "$ref": "#/$defs/languages"
                            },
                            "priority": {
                                "description": "Optional, defaults to 1. Lower numbers are considered higher priority, with 1 being the highest priority. Typically, a title with a higher priority wins when Retool is choosing a 1G1R title.",
                                "$comment": "The `priority` value must be an integer greater than 1. Higher numbers are lower priority. For priorities of `1`, remove the `priority` property, as `1` is the default.",
                                "type": "integer",
                                "minimum": 1
                            }
                        }
                    }
                }
            }
        },
        "languages": {
            "minProperties": 1,
            "additionalProperties": false,
            "properties": {
                "afrikaans": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "albanian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "arabic": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "basque": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "bulgarian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "catalan": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "chinese (simplified)": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "chinese (traditional)": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "cornish": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "croatian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "czech": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "danish": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "dutch": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "english": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "estonian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "finnish": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "french": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "french (canadian)": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "gaelic": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "german": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "greek": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "hebrew": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "hindi": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "hungarian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "icelandic": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "indonesian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "italian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "japanese": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "korean": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "latvian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "lithuanian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "macedonian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "norwegian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "polish": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "portuguese": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "portuguese (brazilian)": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "punjabi": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "romanian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "russian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "serbian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "slovak": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "slovenian": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "spanish": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "spanish (latin american)": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "spanish (mexican)": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "swedish": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "tamil": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "thai": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "turkish": {
                    "$ref": "#/$defs/nonEmptyString"
                },
                "ukrainian": {
                    "$ref": "#/$defs/nonEmptyString"
                }
            }
        },
        "nameType": {
            "enum": [
                "short",
                "full",
                "regionFree",
                "regex"
            ]
        },
        "regions": {
            "enum": [
                "Albania",
                "Argentina",
                "Asia",
                "Australia",
                "Austria",
                "Belgium",
                "Brazil",
                "Bulgaria",
                "Canada",
                "China",
                "Croatia",
                "Czech",
                "Denmark",
                "Estonia",
                "Europe",
                "Finland",
                "France",
                "Germany",
                "Greece",
                "Hong Kong",
                "Hungary",
                "Iceland",
                "India",
                "Indonesia",
                "Ireland",
                "Israel",
                "Italy",
                "Japan",
                "Korea",
                "Latin America",
                "Latvia",
                "Lithuania",
                "Macedonia",
                "Mexico",
                "Netherlands",
                "New Zealand",
                "Norway",
                "Poland",
                "Portugal",
                "Romania",
                "Russia",
                "Scandinavia",
                "Serbia",
                "Singapore",
                "Slovakia",
                "Slovenia",
                "South Africa",
                "Spain",
                "Sweden",
                "Switzerland",
                "Taiwan",
                "Thailand",
                "Turkey",
                "UK",
                "Ukraine",
                "United Arab Emirates",
                "Unknown",
                "USA",
                "World",
                "All other regions"
            ]
        }
    }
}
