{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://davit.in/schemas/mx/file-types.json",
  "title": "mx file-types",
  "description": "Canonical file type record used by DAVIT validation and archive ingest.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "extension",
    "mediaType",
    "kind"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^ft:[a-z0-9][a-z0-9.-]+$",
      "description": "Stable file-type identifier."
    },
    "extension": {
      "type": "string",
      "pattern": "^\\.[a-z0-9.]+$"
    },
    "mediaType": {
      "type": "string",
      "description": "IANA media type or x-davit vendor type."
    },
    "kind": {
      "type": "string",
      "enum": [
        "document",
        "image",
        "audio",
        "video",
        "archive",
        "data",
        "code",
        "other"
      ]
    },
    "aliases": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "preservation": {
      "type": "string",
      "enum": [
        "preferred",
        "acceptable",
        "normalize",
        "reject"
      ]
    },
    "notes": {
      "type": "string"
    }
  },
  "examples": [
    {
      "id": "ft:markdown",
      "extension": ".md",
      "mediaType": "text/markdown",
      "kind": "document",
      "preservation": "preferred"
    }
  ]
}
