{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "imports-v2/card_types.json",
  "title": "Card types",
  "description": "A type of cards, such as Task or Bug, with its own color and fields. Cards of the type show the first letter of its name. Give one record per type; cards refer to it with `type_ref`, and a board may choose one as its default. A type with the same name already in the company is reused and keeps its own field settings; when `card_properties` differ from them, the import reports those entries as not applied. Names are distinct without regard to case.",
  "type": "object",
  "properties": {
    "external_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "description": "Your own identifier of the record, for example `k-mrr`, unique within the resource across all of its files and case sensitive. Other records refer to this one by it."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "description": "Name of the type, for example `Metric`. Up to 128 characters; names are distinct without regard to case."
    },
    "color": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^#[0-9A-Fa-f]{6}$",
      "x-palette": "card_type_colors",
      "description": "Type color. It is replaced with the nearest color of the card type palette; an omitted color gets a default one."
    },
    "card_properties": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "property_ref": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "x-ref": "custom_properties",
            "description": "A custom property of the entry."
          },
          "field": {
            "type": "string",
            "enum": [
              "size",
              "due_date",
              "tags",
              "timeline",
              "description"
            ],
            "description": "A built-in card field of the entry."
          },
          "required": {
            "type": "boolean",
            "description": "Whether the field must be filled; the default is false."
          }
        },
        "required": [],
        "additionalProperties": false,
        "oneOf": [
          {
            "required": [
              "property_ref"
            ]
          },
          {
            "required": [
              "field"
            ]
          }
        ]
      },
      "description": "Works like an empty form for cards of this type: the fields listed here appear on every such card from the start, in this order, even before anyone fills them in. Nothing is pre-filled, and a card can still get other fields. Each item is one of your custom properties, `{\"property_ref\": \"cp-priority\"}`, or a standard card field, `{\"field\": \"due_date\"}`; add `\"required\": true` if it must be filled in (for a standard field that is its only effect). An existing card type that is reused keeps its own list, and the items that differ are reported."
    },
    "author_ref": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 512,
      "x-ref": "users",
      "description": "The user who created the record, by the external_id of a `users` record, for example `u-ava`. Leave it out or use null when the author is unknown or has left."
    }
  },
  "required": [
    "external_id",
    "name"
  ],
  "additionalProperties": false
}
