{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thesignup-app/json-schema/thesignup-app-create-item-request-schema.json",
  "title": "CreateItemRequest",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thesignup-app-openapi.json#/components/schemas/CreateItemRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "description": {
      "type": "string",
      "maxLength": 2000
    },
    "quantityNeeded": {
      "type": "integer",
      "minimum": 1
    },
    "maxPerPerson": {
      "type": "integer",
      "minimum": 0
    },
    "customField": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "required": {
          "type": "boolean"
        },
        "type": {
          "type": "string",
          "enum": [
            "short",
            "long"
          ]
        }
      },
      "required": [
        "name",
        "required",
        "type"
      ]
    },
    "askDetails": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "label": {
          "type": "string"
        },
        "placeholder": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        }
      },
      "required": [
        "enabled",
        "label",
        "placeholder"
      ],
      "description": "The organizer's question. When enabled, label must not be blank."
    },
    "category": {
      "type": "string"
    },
    "sortOrder": {
      "type": "integer"
    },
    "scope": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "day"
              ]
            },
            "dayId": {
              "type": "string",
              "format": "uuid",
              "description": "An event day of THIS signup (ids come from GET /signups/{id}/days)."
            }
          },
          "required": [
            "kind",
            "dayId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "slot"
              ]
            },
            "slotId": {
              "type": "string",
              "format": "uuid",
              "description": "A time slot of THIS signup."
            }
          },
          "required": [
            "kind",
            "slotId"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Where the item lives. Omitted or null on create is a whole-signup item. On PATCH, omitted leaves the scope unchanged, null detaches the item to whole-signup, and a day or slot replaces the old scope (a slot-scoped item can move to a day and back). A cancelled day or slot of this signup is accepted, and participants are not offered the item until it is uncancelled."
    }
  },
  "required": [
    "name",
    "quantityNeeded"
  ]
}