{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hushspec.dev/schemas/hushspec-registry-media-types.v0.schema.json",
  "title": "HushSpec Media-Type Registry v0",
  "description": "Shape of spec/registries/media-types.yaml.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "registry",
    "registry_version",
    "status",
    "entries"
  ],
  "properties": {
    "registry": {
      "const": "media-types"
    },
    "registry_version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "status": {
      "type": "string",
      "enum": [
        "closed",
        "open"
      ]
    },
    "entries": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "carries",
          "extensions",
          "spec"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^application/vnd\\.hushspec(\\.[a-z]+)?\\+(yaml|json|jsonl)$"
          },
          "carries": {
            "type": "string",
            "minLength": 1
          },
          "extensions": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "pattern": "^\\.[a-z0-9.]+$"
            }
          },
          "spec": {
            "type": "string",
            "minLength": 1,
            "description": "The defining specification and section, for example `core 3.4`."
          }
        }
      }
    }
  }
}
