{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dotsy-ai/json-schema/dotsy-ai-collection-field-schema.json",
  "title": "CollectionField",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dotsy-ai-collections-api-openapi.yml#/components/schemas/CollectionField",
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Field key: starts with a letter; letters, digits and `_`; at most 40 characters."
    },
    "type": {
      "type": "string",
      "enum": [
        "text",
        "number",
        "boolean",
        "option",
        "multiOption",
        "link",
        "email",
        "phone",
        "color"
      ]
    },
    "label": {
      "type": "string",
      "maxLength": 80
    },
    "help": {
      "type": "string",
      "maxLength": 200
    },
    "required": {
      "type": "boolean"
    },
    "unique": {
      "type": "boolean",
      "description": "Stored now; checked from a later release."
    },
    "inCard": {
      "type": "boolean"
    },
    "default": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Filled in when a post is created without this field."
    },
    "options": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "`option` and `multiOption` only (required there): 1–100 unique choices."
    },
    "multiline": {
      "type": "boolean"
    },
    "minLength": {
      "type": "integer"
    },
    "maxLength": {
      "type": "integer"
    },
    "min": {
      "type": "number"
    },
    "max": {
      "type": "number",
      "description": "`number`: the largest value. `multiOption`: the most choices."
    },
    "integer": {
      "type": "boolean"
    }
  },
  "required": [
    "key",
    "type"
  ]
}