{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "definitions": {
        "string_limit": {
            "maxLength": 1000
        },
        "country_code": {
            "pattern": "^[A-Z]{2}(-[A-Z0-9]{1,3})?$"
        },
        "id": {
            "maxLength": 1000,
            "pattern": "^[a-z0-9+]+(_[a-z0-9+]+)*$"
        },
        "logo": {
            "pattern": "^logo\\.(png|jpg|svg)$"
        }
    },
    "properties": {
        "uuid": {
            "type": "string",
            "title": "UUID",
            "description": "Canonical UUID (UUIDv4), assigned automatically by CI on merge. Leave empty when creating.",
            "readOnly": true,
            "pattern": "^$|^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "moved_from": {
            "type": "array",
            "title": "Moved From",
            "description": "Former canonical UUIDv4(s) this entity previously had (before a merge or move). Lets old UUID references resolve here. Managed by tooling/CI — leave empty when creating.",
            "readOnly": true,
            "items": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
            }
        },
        "id": {
            "type": "string",
            "title": "ID",
            "description": "The unique identifier for this brand",
            "$ref": "#/definitions/id"
        },
        "name": {
            "type": "string",
            "title": "Name",
            "description": "The name of the filament manufacturer",
            "$ref": "#/definitions/string_limit"
        },
        "website": {
            "type": "string",
            "title": "Website",
            "description": "The manufacturer's official website",
            "x-placeholder": "https://example.com/...",
            "$ref": "#/definitions/string_limit"
        },
        "logo": {
            "type": "string",
            "title": "Logo",
            "description": "The name of the logo file",
            "$ref": "#/definitions/logo"
        },
        "origin": {
            "type": "string",
            "title": "Country of Origin",
            "description": "ISO 3166 country code, optionally with subdivision (e.g., US, DE, GB-NIR) or Unknown",
            "x-placeholder": "e.g., US",
            "anyOf": [
                { "$ref": "#/definitions/country_code" },
                { "const": "Unknown" }
            ]
        },
        "source": {
            "type": "string",
            "description": "The source of the data, like another DB or company",
            "$ref": "#/definitions/string_limit"
        }
    },
    "required": [
        "id",
        "name",
        "logo",
        "website",
        "origin"
    ],
    "additionalProperties": false
}
