{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agilehero-io/json-schema/agilehero-io-card-schema.json",
  "title": "Card",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agilehero-io-openapi.yml#/components/schemas/Card",
  "type": "object",
  "required": [
    "id",
    "number",
    "title",
    "type",
    "description_present",
    "list",
    "epic",
    "project",
    "assignees",
    "labels",
    "due_date",
    "estimation",
    "position",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "number": {
      "type": "integer",
      "description": "The card's number within its project."
    },
    "title": {
      "type": "string"
    },
    "type": {
      "$ref": "#/$defs/CardType"
    },
    "description_present": {
      "type": "boolean",
      "description": "Whether the card has a description (lists do not include the body)."
    },
    "list": {
      "$ref": "#/$defs/NullableReference"
    },
    "epic": {
      "$ref": "#/$defs/NullableReference"
    },
    "project": {
      "$ref": "#/$defs/Reference"
    },
    "assignees": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Reference"
      }
    },
    "labels": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Reference"
      }
    },
    "due_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "estimation": {
      "type": [
        "integer",
        "null"
      ]
    },
    "position": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Position in its list or the backlog (0 is the bottom; higher is nearer the top)."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "CardType": {
      "type": "string",
      "enum": [
        "story",
        "bug",
        "chore",
        "research"
      ]
    },
    "NullableReference": {
      "type": [
        "object",
        "null"
      ],
      "description": "A reference, or null (a card's list is null in the backlog; its epic when it has none).",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "Reference": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}