{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cosuno/json-schema/cosuno-custom-field-response-without-position-schema.json",
  "title": "CustomFieldResponseWithoutPosition",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cosuno-bid-package-custom-fields-api-openapi.yml#/components/schemas/CustomFieldResponseWithoutPosition",
  "anyOf": [
    {
      "$ref": "#/$defs/CustomFieldResponseSelect"
    },
    {
      "$ref": "#/$defs/CustomFieldResponseNonSelect"
    }
  ],
  "$defs": {
    "CustomFieldResponseNonSelect": {
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the custom field."
        },
        "label": {
          "type": "string",
          "description": "Display label of the custom field."
        },
        "type": {
          "$ref": "#/$defs/Exclude_CUSTOM_FIELD_TYPE.CustomFieldSelectTypes_",
          "description": "Non-select field type (e.g. `text`, `number`, `date`, `checkbox`)."
        },
        "isRequired": {
          "type": "boolean",
          "description": "Whether a value for this custom field is required when creating or updating the parent entity."
        }
      },
      "required": [
        "id",
        "label",
        "type",
        "isRequired"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CustomFieldResponseSelect": {
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the custom field."
        },
        "label": {
          "type": "string",
          "description": "Display label of the custom field."
        },
        "type": {
          "$ref": "#/$defs/CustomFieldSelectTypes",
          "description": "Single- or multi-select field type."
        },
        "options": {
          "items": {
            "properties": {
              "label": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "label",
              "id"
            ],
            "type": "object"
          },
          "type": "array",
          "description": "Available options for this field."
        },
        "isRequired": {
          "type": "boolean",
          "description": "Whether a value for this custom field is required when creating or updating the parent entity."
        }
      },
      "required": [
        "id",
        "label",
        "type",
        "options",
        "isRequired"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CustomFieldSelectTypes": {
      "type": "string",
      "enum": [
        "singleSelect",
        "multiSelect"
      ]
    },
    "Exclude_CUSTOM_FIELD_TYPE.CustomFieldSelectTypes_": {
      "type": "string",
      "enum": [
        "number",
        "checkbox",
        "currency",
        "date",
        "dateTime",
        "text"
      ],
      "description": "Exclude from T those types that are assignable to U"
    }
  }
}