{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "label": {
          "description": "Override the field label",
          "examples": [
            "My label"
          ],
          "type": "string"
        },
        "hideLabel": {
          "description": "Hide the field label",
          "type": "boolean"
        },
        "placeholder": {
          "description": "Placeholder text shown inside the input when empty",
          "examples": [
            "Search..."
          ],
          "type": "string"
        },
        "readonly": {
          "description": "Render the field in read-only mode",
          "type": "boolean"
        },
        "disabled": {
          "description": "Always render the input disabled",
          "type": "boolean"
        },
        "errorMessage": {
          "description": "Replace the validation error text shown under the input",
          "examples": [
            "Please fill this in"
          ],
          "type": "string"
        },
        "disabledWhen": {
          "description": "Disable the input when the condition matches another field",
          "examples": [
            {
              "field": "id",
              "exists": true
            }
          ],
          "type": "object",
          "properties": {
            "field": {
              "type": "string",
              "description": "The other column id whose value is evaluated for the condition."
            },
            "eq": {
              "description": "Show/hide/disable when the field value equals this value."
            },
            "neq": {
              "description": "Show/hide/disable when the field value does NOT equal this value."
            },
            "exists": {
              "description": "When true, show/hide/disable when the field has a non-empty value.",
              "type": "boolean"
            },
            "notExists": {
              "description": "When true, show/hide/disable when the field has no value.",
              "type": "boolean"
            }
          },
          "required": [
            "field"
          ]
        },
        "colspan": {
          "description": "Grid column span (1–12)",
          "examples": [
            6,
            12
          ],
          "type": "number"
        },
        "width": {
          "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
          "examples": [
            "md",
            "240px"
          ],
          "type": "string"
        },
        "styles": {
          "description": "Inline CSS style object applied to the field wrapper",
          "examples": [
            {
              "color": "red"
            }
          ],
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        "customRender": {
          "description": "Name of a globally registered Vue component to render instead of the default input",
          "examples": [
            "MyCustomInput"
          ],
          "type": "string"
        },
        "labelKey": {
          "description": "Object key used as the display label in the dropdown",
          "examples": [
            "label",
            "name"
          ],
          "type": "string"
        },
        "valueKey": {
          "description": "Object key used as the stored value",
          "examples": [
            "value",
            "id"
          ],
          "type": "string"
        },
        "freeText": {
          "description": "Allow the user to type a value not in the options list",
          "type": "boolean"
        },
        "enableCreate": {
          "description": "Show a \"create\" action when no matching option is found",
          "type": "boolean"
        },
        "storeValue": {
          "description": "Store option[valueKey] instead of the whole option object",
          "type": "boolean"
        },
        "exclude": {
          "description": "Exclude already-selected values from the lookup results",
          "type": "object",
          "properties": {
            "values": {
              "description": "Values to exclude. A {form.path} placeholder or a literal array.",
              "examples": [
                "{form.coAuthors}",
                [
                  "1",
                  "2"
                ]
              ],
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {}
                }
              ]
            },
            "key": {
              "description": "Filter field for server-side exclusion. Defaults to valueKey.",
              "examples": [
                "id"
              ],
              "type": "string"
            },
            "selected": {
              "description": "Also exclude the control's own current value(s). Default false.",
              "type": "boolean"
            }
          },
          "title": "Exclude options"
        },
        "options": {
          "type": "array",
          "items": {},
          "description": "Inline array of option items",
          "examples": [
            [
              {
                "label": "Active",
                "value": "active"
              }
            ]
          ]
        },
        "values": {
          "description": "Alias for options (deprecated — prefer options)",
          "deprecated": true,
          "type": "array",
          "items": {}
        }
      },
      "required": [
        "options"
      ],
      "additionalProperties": {},
      "title": "Inline autocomplete",
      "description": "Options provided as an inline array"
    },
    {
      "type": "object",
      "properties": {
        "label": {
          "description": "Override the field label",
          "examples": [
            "My label"
          ],
          "type": "string"
        },
        "hideLabel": {
          "description": "Hide the field label",
          "type": "boolean"
        },
        "placeholder": {
          "description": "Placeholder text shown inside the input when empty",
          "examples": [
            "Search..."
          ],
          "type": "string"
        },
        "readonly": {
          "description": "Render the field in read-only mode",
          "type": "boolean"
        },
        "disabled": {
          "description": "Always render the input disabled",
          "type": "boolean"
        },
        "errorMessage": {
          "description": "Replace the validation error text shown under the input",
          "examples": [
            "Please fill this in"
          ],
          "type": "string"
        },
        "disabledWhen": {
          "description": "Disable the input when the condition matches another field",
          "examples": [
            {
              "field": "id",
              "exists": true
            }
          ],
          "type": "object",
          "properties": {
            "field": {
              "type": "string",
              "description": "The other column id whose value is evaluated for the condition."
            },
            "eq": {
              "description": "Show/hide/disable when the field value equals this value."
            },
            "neq": {
              "description": "Show/hide/disable when the field value does NOT equal this value."
            },
            "exists": {
              "description": "When true, show/hide/disable when the field has a non-empty value.",
              "type": "boolean"
            },
            "notExists": {
              "description": "When true, show/hide/disable when the field has no value.",
              "type": "boolean"
            }
          },
          "required": [
            "field"
          ]
        },
        "colspan": {
          "description": "Grid column span (1–12)",
          "examples": [
            6,
            12
          ],
          "type": "number"
        },
        "width": {
          "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
          "examples": [
            "md",
            "240px"
          ],
          "type": "string"
        },
        "styles": {
          "description": "Inline CSS style object applied to the field wrapper",
          "examples": [
            {
              "color": "red"
            }
          ],
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        "customRender": {
          "description": "Name of a globally registered Vue component to render instead of the default input",
          "examples": [
            "MyCustomInput"
          ],
          "type": "string"
        },
        "labelKey": {
          "description": "Object key used as the display label in the dropdown",
          "examples": [
            "label",
            "name"
          ],
          "type": "string"
        },
        "valueKey": {
          "description": "Object key used as the stored value",
          "examples": [
            "value",
            "id"
          ],
          "type": "string"
        },
        "freeText": {
          "description": "Allow the user to type a value not in the options list",
          "type": "boolean"
        },
        "enableCreate": {
          "description": "Show a \"create\" action when no matching option is found",
          "type": "boolean"
        },
        "storeValue": {
          "description": "Store option[valueKey] instead of the whole option object",
          "type": "boolean"
        },
        "exclude": {
          "description": "Exclude already-selected values from the lookup results",
          "type": "object",
          "properties": {
            "values": {
              "description": "Values to exclude. A {form.path} placeholder or a literal array.",
              "examples": [
                "{form.coAuthors}",
                [
                  "1",
                  "2"
                ]
              ],
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {}
                }
              ]
            },
            "key": {
              "description": "Filter field for server-side exclusion. Defaults to valueKey.",
              "examples": [
                "id"
              ],
              "type": "string"
            },
            "selected": {
              "description": "Also exclude the control's own current value(s). Default false.",
              "type": "boolean"
            }
          },
          "title": "Exclude options"
        },
        "uri": {
          "type": "string",
          "description": "Remote endpoint URL that returns option items",
          "examples": [
            "/api/authors"
          ]
        },
        "dataField": {
          "description": "Field in the API response containing the data array",
          "examples": [
            "data",
            "results"
          ],
          "type": "string"
        },
        "skipAuth": {
          "description": "Send the request without authentication headers",
          "type": "boolean"
        }
      },
      "required": [
        "uri"
      ],
      "additionalProperties": {},
      "title": "Remote autocomplete",
      "description": "Options fetched from a remote endpoint"
    },
    {
      "type": "object",
      "properties": {
        "label": {
          "description": "Override the field label",
          "examples": [
            "My label"
          ],
          "type": "string"
        },
        "hideLabel": {
          "description": "Hide the field label",
          "type": "boolean"
        },
        "placeholder": {
          "description": "Placeholder text shown inside the input when empty",
          "examples": [
            "Search..."
          ],
          "type": "string"
        },
        "readonly": {
          "description": "Render the field in read-only mode",
          "type": "boolean"
        },
        "disabled": {
          "description": "Always render the input disabled",
          "type": "boolean"
        },
        "errorMessage": {
          "description": "Replace the validation error text shown under the input",
          "examples": [
            "Please fill this in"
          ],
          "type": "string"
        },
        "disabledWhen": {
          "description": "Disable the input when the condition matches another field",
          "examples": [
            {
              "field": "id",
              "exists": true
            }
          ],
          "type": "object",
          "properties": {
            "field": {
              "type": "string",
              "description": "The other column id whose value is evaluated for the condition."
            },
            "eq": {
              "description": "Show/hide/disable when the field value equals this value."
            },
            "neq": {
              "description": "Show/hide/disable when the field value does NOT equal this value."
            },
            "exists": {
              "description": "When true, show/hide/disable when the field has a non-empty value.",
              "type": "boolean"
            },
            "notExists": {
              "description": "When true, show/hide/disable when the field has no value.",
              "type": "boolean"
            }
          },
          "required": [
            "field"
          ]
        },
        "colspan": {
          "description": "Grid column span (1–12)",
          "examples": [
            6,
            12
          ],
          "type": "number"
        },
        "width": {
          "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
          "examples": [
            "md",
            "240px"
          ],
          "type": "string"
        },
        "styles": {
          "description": "Inline CSS style object applied to the field wrapper",
          "examples": [
            {
              "color": "red"
            }
          ],
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        "customRender": {
          "description": "Name of a globally registered Vue component to render instead of the default input",
          "examples": [
            "MyCustomInput"
          ],
          "type": "string"
        },
        "labelKey": {
          "description": "Object key used as the display label in the dropdown",
          "examples": [
            "label",
            "name"
          ],
          "type": "string"
        },
        "valueKey": {
          "description": "Object key used as the stored value",
          "examples": [
            "value",
            "id"
          ],
          "type": "string"
        },
        "freeText": {
          "description": "Allow the user to type a value not in the options list",
          "type": "boolean"
        },
        "enableCreate": {
          "description": "Show a \"create\" action when no matching option is found",
          "type": "boolean"
        },
        "storeValue": {
          "description": "Store option[valueKey] instead of the whole option object",
          "type": "boolean"
        },
        "exclude": {
          "description": "Exclude already-selected values from the lookup results",
          "type": "object",
          "properties": {
            "values": {
              "description": "Values to exclude. A {form.path} placeholder or a literal array.",
              "examples": [
                "{form.coAuthors}",
                [
                  "1",
                  "2"
                ]
              ],
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {}
                }
              ]
            },
            "key": {
              "description": "Filter field for server-side exclusion. Defaults to valueKey.",
              "examples": [
                "id"
              ],
              "type": "string"
            },
            "selected": {
              "description": "Also exclude the control's own current value(s). Default false.",
              "type": "boolean"
            }
          },
          "title": "Exclude options"
        },
        "resource": {
          "type": "string",
          "description": "Relative path to a resource.json used to populate the options",
          "examples": [
            "./author.resource.json"
          ]
        },
        "skipAuth": {
          "description": "Send the request without authentication headers",
          "type": "boolean"
        },
        "dataField": {
          "description": "Field in the API response containing the data array",
          "examples": [
            "data",
            "results"
          ],
          "type": "string"
        }
      },
      "required": [
        "resource"
      ],
      "additionalProperties": {},
      "title": "Resource autocomplete",
      "description": "Options populated from a crouton resource"
    },
    {
      "type": "object",
      "properties": {
        "label": {
          "description": "Override the field label",
          "examples": [
            "My label"
          ],
          "type": "string"
        },
        "hideLabel": {
          "description": "Hide the field label",
          "type": "boolean"
        },
        "placeholder": {
          "description": "Placeholder text shown inside the input when empty",
          "examples": [
            "Search..."
          ],
          "type": "string"
        },
        "readonly": {
          "description": "Render the field in read-only mode",
          "type": "boolean"
        },
        "disabled": {
          "description": "Always render the input disabled",
          "type": "boolean"
        },
        "errorMessage": {
          "description": "Replace the validation error text shown under the input",
          "examples": [
            "Please fill this in"
          ],
          "type": "string"
        },
        "disabledWhen": {
          "description": "Disable the input when the condition matches another field",
          "examples": [
            {
              "field": "id",
              "exists": true
            }
          ],
          "type": "object",
          "properties": {
            "field": {
              "type": "string",
              "description": "The other column id whose value is evaluated for the condition."
            },
            "eq": {
              "description": "Show/hide/disable when the field value equals this value."
            },
            "neq": {
              "description": "Show/hide/disable when the field value does NOT equal this value."
            },
            "exists": {
              "description": "When true, show/hide/disable when the field has a non-empty value.",
              "type": "boolean"
            },
            "notExists": {
              "description": "When true, show/hide/disable when the field has no value.",
              "type": "boolean"
            }
          },
          "required": [
            "field"
          ]
        },
        "colspan": {
          "description": "Grid column span (1–12)",
          "examples": [
            6,
            12
          ],
          "type": "number"
        },
        "width": {
          "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
          "examples": [
            "md",
            "240px"
          ],
          "type": "string"
        },
        "styles": {
          "description": "Inline CSS style object applied to the field wrapper",
          "examples": [
            {
              "color": "red"
            }
          ],
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        "customRender": {
          "description": "Name of a globally registered Vue component to render instead of the default input",
          "examples": [
            "MyCustomInput"
          ],
          "type": "string"
        },
        "labelKey": {
          "description": "Object key used as the display label in the dropdown",
          "examples": [
            "label",
            "name"
          ],
          "type": "string"
        },
        "valueKey": {
          "description": "Object key used as the stored value",
          "examples": [
            "value",
            "id"
          ],
          "type": "string"
        },
        "freeText": {
          "description": "Allow the user to type a value not in the options list",
          "type": "boolean"
        },
        "enableCreate": {
          "description": "Show a \"create\" action when no matching option is found",
          "type": "boolean"
        },
        "storeValue": {
          "description": "Store option[valueKey] instead of the whole option object",
          "type": "boolean"
        },
        "exclude": {
          "description": "Exclude already-selected values from the lookup results",
          "type": "object",
          "properties": {
            "values": {
              "description": "Values to exclude. A {form.path} placeholder or a literal array.",
              "examples": [
                "{form.coAuthors}",
                [
                  "1",
                  "2"
                ]
              ],
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {}
                }
              ]
            },
            "key": {
              "description": "Filter field for server-side exclusion. Defaults to valueKey.",
              "examples": [
                "id"
              ],
              "type": "string"
            },
            "selected": {
              "description": "Also exclude the control's own current value(s). Default false.",
              "type": "boolean"
            }
          },
          "title": "Exclude options"
        }
      },
      "additionalProperties": {},
      "title": "Common autocomplete options",
      "description": "Shared options available on all autocomplete variants"
    }
  ],
  "title": "Crouton fieldInput options: autocomplete",
  "description": "Autocomplete options: inline array, remote URI, or resource reference",
  "$id": "https://ghentcdh.github.io/crouton/schema/v1/autocomplete.field-input.schema.json",
  "markdownDescription": "Autocomplete options: inline array, remote URI, or resource reference\n\n[Docs](https://ghentcdh.github.io/crouton/guide/2.resources/field-inputs/autocomplete)"
}
