{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://filamentfacts.com/schema/filament.schema.json",
  "title": "FilamentFacts filament",
  "type": "object",
  "description": "Normalized 3D-printer filament record. Null and empty values mean the imported source did not list the spec. FilamentFacts does not fill those gaps.",
  "required": [
    "brand",
    "brandSlug",
    "product",
    "slug",
    "material",
    "materialSlug",
    "nozzleTempC",
    "bedTempC",
    "speeds",
    "drying",
    "enclosure",
    "hardenedNozzle",
    "spoolWeightsG",
    "pricePerKg",
    "sourceUrl",
    "verifiedDate",
    "provenance",
    "citation"
  ],
  "properties": {
    "brand": {
      "type": "string"
    },
    "brandSlug": {
      "type": "string"
    },
    "product": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "material": {
      "type": "string",
      "description": "Source material code, such as PLA or PA6."
    },
    "materialSlug": {
      "type": "string"
    },
    "materialLabel": {
      "type": "string"
    },
    "nozzleTempC": {
      "$ref": "#/$defs/tempRange"
    },
    "bedTempC": {
      "$ref": "#/$defs/tempRange"
    },
    "speeds": {
      "type": "object",
      "properties": {
        "printMmS": {
          "$ref": "#/$defs/range"
        },
        "volumetricMm3S": {
          "$ref": "#/$defs/range"
        }
      }
    },
    "drying": {
      "type": "object",
      "properties": {
        "maxTempC": {
          "type": [
            "integer",
            "null"
          ]
        },
        "hours": {
          "type": [
            "number",
            "null"
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "filament",
            "material-default",
            null
          ]
        }
      }
    },
    "enclosure": {
      "type": "object",
      "properties": {
        "required": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "chamberTempC": {
          "type": "object",
          "properties": {
            "min": {
              "type": [
                "integer",
                "null"
              ]
            },
            "ideal": {
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        }
      }
    },
    "hardenedNozzle": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "spoolWeightsG": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "pricePerKg": {
      "type": [
        "number",
        "null"
      ]
    },
    "priceCurrency": {
      "type": [
        "string",
        "null"
      ]
    },
    "sourceUrl": {
      "type": "string"
    },
    "verifiedDate": {
      "type": "string",
      "description": "Upstream dataset generation date (YYYY-MM-DD), not a FilamentFacts lab test."
    },
    "provenance": {
      "type": "array"
    },
    "citation": {
      "type": "string"
    },
    "missing": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "tempRange": {
      "type": "object",
      "properties": {
        "min": {
          "type": [
            "integer",
            "null"
          ]
        },
        "max": {
          "type": [
            "integer",
            "null"
          ]
        },
        "singleValue": {
          "type": "boolean"
        }
      }
    },
    "range": {
      "type": "object",
      "properties": {
        "min": {
          "type": [
            "number",
            "null"
          ]
        },
        "max": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    }
  }
}
