{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/terminal49/json-schema/terminal49-document-schema-schema.json",
  "title": "Document Schema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/terminal49-document-schemas-api-openapi.yml#/components/schemas/document_schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "document_schema"
      ]
    },
    "attributes": {
      "type": "object",
      "properties": {
        "document_type": {
          "type": "string",
          "description": "Document type this schema applies to (for example, commercial_invoice)."
        },
        "label": {
          "type": "string",
          "description": "Human-readable label for the document type."
        },
        "schema_version": {
          "type": "string",
          "description": "Public schema version identifier."
        },
        "full_version": {
          "type": "string",
          "description": "Fully-qualified schema version id (for example, commercial_invoice@2026-03-23)."
        },
        "current": {
          "type": "boolean",
          "description": "Whether this schema version is currently active."
        },
        "draft": {
          "type": "boolean",
          "description": "Whether this schema version is marked as draft."
        },
        "active_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Timestamp when this schema version became active."
        },
        "schema_format": {
          "type": "string",
          "enum": [
            "json_schema"
          ],
          "description": "Schema payload format."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional notes describing this schema."
        },
        "schema_payload": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON Schema payload used to validate and describe extracted fields."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "When this schema record was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "When this schema record was last updated."
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "id",
    "type"
  ]
}