{
    "type": "object",
    "definitions": {
        "string_limit": {
            "maxLength": 1000
        },
        "id": {
            "maxLength": 1000,
            "pattern": "^[a-z0-9+]+(_[a-z0-9+]+)*$"
        }
    },
    "x-trait-categories": {
        "appearance": "Appearance",
        "color_effects": "Color Effects",
        "imitates": "Imitates",
        "environmental": "Environmental",
        "properties": "Properties",
        "electrical": "Electrical/Magnetic",
        "special": "Special",
        "contains": "Contains",
        "contains_organic": "Contains Organic",
        "contains_metal": "Contains Metal"
    },
    "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 variant",
            "$ref": "#/definitions/id"
        },
        "name": {
            "type": "string",
            "title": "Color Name",
            "description": "The manufacturer's name for this filament color",
            "x-placeholder": "e.g., Galaxy Black",
            "$ref": "#/definitions/string_limit"
        },
        "color_hex": {
            "type": [
                "string",
                "array"
            ],
            "title": "Color Hex",
            "items": {
                "type": "string",
                "pattern": "^#[a-fA-F0-9]{6}$"
            },
            "pattern": "^#[a-fA-F0-9]{6}$",
            "description": "The official hex color code for this filament (e.g., #FF5733)"
        },
        "hex_variants": {
            "type": "array",
            "title": "Hex Variants",
            "items": {
                "type": "string",
                "pattern": "^#[a-fA-F0-9]{6}$"
            },
            "description": "Alternative hex color codes that this filament is known to report or be identified as (e.g., via NFC)"
        },
        "discontinued": {
            "type": "boolean",
            "title": "Discontinued",
            "description": "Mark if this color variant has been discontinued"
        },
        "color_standards": {
            "type": "object",
            "properties": {
                "ral": {
                    "type": "string",
                    "$ref": "#/definitions/string_limit"
                },
                "ncs":{
                    "type": "string",
                    "$ref": "#/definitions/string_limit"
                },
                "pantone": {
                    "type": "string",
                    "$ref": "#/definitions/string_limit"
                },
                "bs":{
                    "type": "string",
                    "$ref": "#/definitions/string_limit"
                },
                "munsell": {
                    "type": "string",
                    "$ref": "#/definitions/string_limit"
                }
            }
        },
        "traits": {
            "type": "object",
            "properties": {
                "translucent": {
                    "type": "boolean",
                    "description": "Indicates that the filament is translucent",
                    "x-category": "appearance",
                    "x-label": "Translucent"
                },
                "transparent": {
                    "type": "boolean",
                    "description": "Not fully opaque, does not disperse light (glass-like transparency)",
                    "x-category": "appearance",
                    "x-label": "Transparent"
                },
                "matte": {
                    "type": "boolean",
                    "description": "Indicates that the filament has a matte finish",
                    "x-category": "appearance",
                    "x-label": "Matte"
                },
                "silk": {
                    "type": "boolean",
                    "description": "Produces smooth, shiny/glossy surface",
                    "x-category": "appearance",
                    "x-label": "Silk"
                },
                "glitter": {
                    "type": "boolean",
                    "description": "Contains coarse glitter particles",
                    "x-category": "appearance",
                    "x-label": "Glitter"
                },
                "iridescent": {
                    "type": "boolean",
                    "description": "Changes color based on the viewing angle",
                    "x-category": "appearance",
                    "x-label": "Iridescent"
                },
                "pearlescent": {
                    "type": "boolean",
                    "description": "Reflected light is mostly white (special case of iridescent)",
                    "x-category": "appearance",
                    "x-label": "Pearlescent"
                },
                "neon": {
                    "type": "boolean",
                    "description": "Neon color/glows under UV light (fluorescent)",
                    "x-category": "appearance",
                    "x-label": "Neon/UV"
                },
                "glow": {
                    "type": "boolean",
                    "description": "Indicates that the filament glows in the dark",
                    "x-category": "appearance",
                    "x-label": "Glow in Dark"
                },
                "without_pigments": {
                    "type": "boolean",
                    "description": "The material is of its natural color, no pigments were added",
                    "x-category": "appearance",
                    "x-label": "Natural"
                },
                "temperature_color_change": {
                    "type": "boolean",
                    "description": "Changes color based on the temperature",
                    "x-category": "color_effects",
                    "x-label": "Thermochromic"
                },
                "gradual_color_change": {
                    "type": "boolean",
                    "description": "Transitions between colors as the filament is extruded",
                    "x-category": "color_effects",
                    "x-label": "Gradient"
                },
                "coextruded": {
                    "type": "boolean",
                    "description": "Co-extruded from multiple colors",
                    "x-category": "color_effects",
                    "x-label": "Coextruded"
                },
                "illuminescent_color_change": {
                    "type": "boolean",
                    "description": "The glow color is different to the material base color",
                    "x-category": "color_effects",
                    "x-label": "Glow Color Change"
                },
                "imitates_wood": {
                    "type": "boolean",
                    "description": "Imitates wood",
                    "x-category": "imitates",
                    "x-label": "Wood"
                },
                "imitates_metal": {
                    "type": "boolean",
                    "description": "Imitates metal",
                    "x-category": "imitates",
                    "x-label": "Metal"
                },
                "imitates_marble": {
                    "type": "boolean",
                    "description": "Imitates marble",
                    "x-category": "imitates",
                    "x-label": "Marble"
                },
                "imitates_stone": {
                    "type": "boolean",
                    "description": "Imitates stone",
                    "x-category": "imitates",
                    "x-label": "Stone"
                },
                "lithophane": {
                    "type": "boolean",
                    "description": "Specifically designed for lithophaning",
                    "x-category": "imitates",
                    "x-label": "Lithophane"
                },
                "recycled": {
                    "type": "boolean",
                    "description": "Indicates that the filament was made of recycled materials",
                    "x-category": "environmental",
                    "x-label": "Recycled"
                },
                "recyclable": {
                    "type": "boolean",
                    "description": "Indicates that the filament can be recycled",
                    "x-category": "environmental",
                    "x-label": "Recyclable"
                },
                "biodegradable": {
                    "type": "boolean",
                    "description": "Indicates if the filament will biodegrade",
                    "x-category": "environmental",
                    "x-label": "Biodegradable"
                },
                "home_compostable": {
                    "type": "boolean",
                    "description": "Decomposes into natural elements in a home compost system",
                    "x-category": "environmental",
                    "x-label": "Home Compostable"
                },
                "industrially_compostable": {
                    "type": "boolean",
                    "description": "Decomposes into natural elements in commercial composting facilities",
                    "x-category": "environmental",
                    "x-label": "Industrial Compostable"
                },
                "bio_based": {
                    "type": "boolean",
                    "description": "Predominantly made from renewable biological resources",
                    "x-category": "environmental",
                    "x-label": "Bio-based"
                },
                "abrasive": {
                    "type": "boolean",
                    "description": "The material is abrasive and requires an abrasive-resistant nozzle",
                    "x-category": "properties",
                    "x-label": "Abrasive"
                },
                "foaming": {
                    "type": "boolean",
                    "description": "The material increases its volume during extrusion",
                    "x-category": "properties",
                    "x-label": "Foaming"
                },
                "castable": {
                    "type": "boolean",
                    "description": "The material is suitable to be used as a sacrificial pattern for investment casting",
                    "x-category": "properties",
                    "x-label": "Castable"
                },
                "self_extinguishing": {
                    "type": "boolean",
                    "description": "The material is self-extinguishing",
                    "x-category": "properties",
                    "x-label": "Self Extinguishing"
                },
                "high_temperature": {
                    "type": "boolean",
                    "description": "The material softens at higher temperatures than what is common for the material type",
                    "x-category": "properties",
                    "x-label": "High Temp"
                },
                "high_flow": {
                    "type": "boolean",
                    "description": "Formulated for high volumetric flow, enabling faster print speeds than typical for the material type (also marketed as high-speed)",
                    "x-category": "properties",
                    "x-label": "High Flow"
                },
                "low_outgassing": {
                    "type": "boolean",
                    "description": "Releases only minimal gas when placed in a vacuum",
                    "x-category": "properties",
                    "x-label": "Low Outgassing"
                },
                "water_soluble": {
                    "type": "boolean",
                    "description": "Can be dissolved in water",
                    "x-category": "properties",
                    "x-label": "Water Soluble"
                },
                "ipa_soluble": {
                    "type": "boolean",
                    "description": "Can be dissolved in IPA",
                    "x-category": "properties",
                    "x-label": "IPA Soluble"
                },
                "limonene_soluble": {
                    "type": "boolean",
                    "description": "Can be dissolved in limonene",
                    "x-category": "properties",
                    "x-label": "Limonene Soluble"
                },
                "esd_safe": {
                    "type": "boolean",
                    "description": "The material is static dissipative",
                    "x-category": "electrical",
                    "x-label": "ESD Safe"
                },
                "conductive": {
                    "type": "boolean",
                    "description": "The material can conduct electricity",
                    "x-category": "electrical",
                    "x-label": "Conductive"
                },
                "emi_shielding": {
                    "type": "boolean",
                    "description": "The material can be used for shielding against electromagnetic interference",
                    "x-category": "electrical",
                    "x-label": "EMI Shielding"
                },
                "paramagnetic": {
                    "type": "boolean",
                    "description": "The material has paramagnetic properties",
                    "x-category": "electrical",
                    "x-label": "Paramagnetic"
                },
                "biocompatible": {
                    "type": "boolean",
                    "description": "Certified biocompatibility",
                    "x-category": "special",
                    "x-label": "Biocompatible"
                },
                "antibacterial": {
                    "type": "boolean",
                    "description": "Has antibacterial properties",
                    "x-category": "special",
                    "x-label": "Antibacterial"
                },
                "air_filtering": {
                    "type": "boolean",
                    "description": "Has air filtering properties",
                    "x-category": "special",
                    "x-label": "Air Filtering"
                },
                "radiation_shielding": {
                    "type": "boolean",
                    "description": "Has radiation shielding properties",
                    "x-category": "special",
                    "x-label": "Radiation Shield"
                },
                "filtration_recommended": {
                    "type": "boolean",
                    "description": "Releases a higher concentration of unsafe particles/fumes during printing so a HEPA and carbon filter is strongly recommended",
                    "x-category": "special",
                    "x-label": "Filtration Req."
                },
                "blend": {
                    "type": "boolean",
                    "description": "The material is a blend of multiple polymers",
                    "x-category": "special",
                    "x-label": "Blend"
                },
                "limited_edition": {
                    "type": "boolean",
                    "description": "The material is a limited edition run",
                    "x-category": "special",
                    "x-label": "Limited Edition"
                },
                "contains_carbon": {
                    "type": "boolean",
                    "description": "Contains carbon",
                    "x-category": "contains",
                    "x-label": "Carbon"
                },
                "contains_carbon_fiber": {
                    "type": "boolean",
                    "description": "Contains carbon fibers",
                    "x-category": "contains",
                    "x-label": "Carbon Fiber"
                },
                "contains_carbon_nano_tubes": {
                    "type": "boolean",
                    "description": "Contains carbon nano tubes",
                    "x-category": "contains",
                    "x-label": "Carbon Nanotubes"
                },
                "contains_glass": {
                    "type": "boolean",
                    "description": "Contains glass",
                    "x-category": "contains",
                    "x-label": "Glass"
                },
                "contains_glass_fiber": {
                    "type": "boolean",
                    "description": "Contains glass fibers",
                    "x-category": "contains",
                    "x-label": "Glass Fiber"
                },
                "contains_kevlar": {
                    "type": "boolean",
                    "description": "Contains kevlar",
                    "x-category": "contains",
                    "x-label": "Kevlar"
                },
                "contains_ptfe": {
                    "type": "boolean",
                    "description": "Contains PTFE",
                    "x-category": "contains",
                    "x-label": "PTFE"
                },
                "contains_ceramic": {
                    "type": "boolean",
                    "description": "Contains ceramic",
                    "x-category": "contains",
                    "x-label": "Ceramic"
                },
                "contains_boron_carbide": {
                    "type": "boolean",
                    "description": "Contains boron carbide",
                    "x-category": "contains",
                    "x-label": "Boron Carbide"
                },
                "contains_stone": {
                    "type": "boolean",
                    "description": "Contains stone",
                    "x-category": "contains",
                    "x-label": "Stone"
                },
                "contains_magnetite": {
                    "type": "boolean",
                    "description": "Contains magnetite",
                    "x-category": "contains",
                    "x-label": "Magnetite"
                },
                "contains_organic_material": {
                    "type": "boolean",
                    "description": "Contains organic material",
                    "x-category": "contains_organic",
                    "x-label": "Organic Material"
                },
                "contains_wood": {
                    "type": "boolean",
                    "description": "Contains wood",
                    "x-category": "contains_organic",
                    "x-label": "Wood"
                },
                "contains_cork": {
                    "type": "boolean",
                    "description": "Contains cork",
                    "x-category": "contains_organic",
                    "x-label": "Cork"
                },
                "contains_wax": {
                    "type": "boolean",
                    "description": "Contains wax",
                    "x-category": "contains_organic",
                    "x-label": "Wax"
                },
                "contains_algae": {
                    "type": "boolean",
                    "description": "Contains algae",
                    "x-category": "contains_organic",
                    "x-label": "Algae"
                },
                "contains_bamboo": {
                    "type": "boolean",
                    "description": "Contains bamboo",
                    "x-category": "contains_organic",
                    "x-label": "Bamboo"
                },
                "contains_pine": {
                    "type": "boolean",
                    "description": "Contains pine",
                    "x-category": "contains_organic",
                    "x-label": "Pine"
                },
                "contains_metal": {
                    "type": "boolean",
                    "description": "Contains metal",
                    "x-category": "contains_metal",
                    "x-label": "Metal"
                },
                "contains_bronze": {
                    "type": "boolean",
                    "description": "Contains bronze",
                    "x-category": "contains_metal",
                    "x-label": "Bronze"
                },
                "contains_iron": {
                    "type": "boolean",
                    "description": "Contains iron",
                    "x-category": "contains_metal",
                    "x-label": "Iron"
                },
                "contains_steel": {
                    "type": "boolean",
                    "description": "Contains steel",
                    "x-category": "contains_metal",
                    "x-label": "Steel"
                },
                "contains_silver": {
                    "type": "boolean",
                    "description": "Contains silver",
                    "x-category": "contains_metal",
                    "x-label": "Silver"
                },
                "contains_copper": {
                    "type": "boolean",
                    "description": "Contains copper",
                    "x-category": "contains_metal",
                    "x-label": "Copper"
                },
                "contains_aluminium": {
                    "type": "boolean",
                    "description": "Contains aluminium",
                    "x-category": "contains_metal",
                    "x-label": "Aluminium"
                },
                "contains_brass": {
                    "type": "boolean",
                    "description": "Contains brass",
                    "x-category": "contains_metal",
                    "x-label": "Brass"
                },
                "contains_tungsten": {
                    "type": "boolean",
                    "description": "Contains tungsten",
                    "x-category": "contains_metal",
                    "x-label": "Tungsten"
                }
            },
            "additionalProperties": false
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "name",
        "color_hex"
    ]
}
