{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/loadsmart/json-schema/loadsmart-field-schema.json",
  "title": "Field",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/loadsmart-custom-forms-fields-api-openapi.yml#/components/schemas/Field",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier of the record",
      "readOnly": true
    },
    "createDateTime": {
      "format": "date-time",
      "type": "string",
      "description": "The date and time when the record was created",
      "readOnly": true
    },
    "createdBy": {
      "type": "object",
      "description": "The ID of the user who created the record",
      "readOnly": true
    },
    "lastChangedDateTime": {
      "format": "date-time",
      "type": "string",
      "description": "The date and time when the record was last changed",
      "readOnly": true
    },
    "label": {
      "type": "string",
      "description": "The label of the field, it can be overriden when instantiated by a FormField entity"
    },
    "description": {
      "type": "string",
      "description": "The helper text for the particular field"
    },
    "placeholder": {
      "type": "string",
      "description": "The placeholder for the particular field"
    },
    "type": {
      "$ref": "#/$defs/CustomFieldType"
    },
    "extraFields": {
      "description": "Extra fields for the field, used to render the field in the UI, such as Dropdown options and number validation rules",
      "allOf": [
        {
          "$ref": "#/$defs/FieldExtraFields"
        }
      ]
    },
    "semanticLabel": {
      "type": "object",
      "description": "Optional semantic label grouping for this field"
    }
  },
  "required": [
    "id",
    "createDateTime",
    "createdBy",
    "lastChangedDateTime",
    "label",
    "type"
  ],
  "$defs": {
    "CustomFieldType": {
      "type": "string",
      "description": "The type of the field used at the moment of the data submission, used to render the field in the UI and validate the data on the API level",
      "enum": [
        "str",
        "bigstr",
        "date",
        "bool",
        "doc",
        "multidoc",
        "int",
        "email",
        "phone",
        "dropdown",
        "dropdownmultiselect",
        "combobox",
        "timestamp",
        "action"
      ]
    },
    "FieldExtraFields": {
      "type": "object",
      "properties": {}
    }
  }
}