{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/conversion/json-schema/conversion-field-schema-schema.json",
  "title": "FieldSchema",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/conversion-openapi.json#/components/schemas/FieldSchema",
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Key used in record field maps."
    },
    "label": {
      "type": "string"
    },
    "objectType": {
      "type": "string",
      "enum": [
        "CONTACT",
        "COMPANY",
        "OPPORTUNITY",
        "CAMPAIGN",
        "CAMPAIGN_MEMBER",
        "CUSTOM_OBJECT"
      ]
    },
    "customObjectId": {
      "type": "string",
      "format": "uuid",
      "description": "Present for custom-object fields."
    },
    "dataType": {
      "type": "string",
      "enum": [
        "STRING",
        "NUMBER",
        "BOOLEAN",
        "DATE",
        "DATETIME",
        "PICKLIST",
        "RELATIONSHIP"
      ]
    },
    "readOnly": {
      "type": "boolean",
      "description": "Whether this field is unavailable for writes through the custom-object batch endpoint."
    },
    "relationshipTargets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RelationshipFieldReference"
      },
      "description": "Fields on the other side of this relationship, identified by key and object. For a reverse field, this points to its writable source field."
    }
  },
  "required": [
    "key",
    "label",
    "objectType",
    "dataType",
    "readOnly"
  ],
  "$defs": {
    "RelationshipFieldReference": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "objectType": {
          "type": "string",
          "enum": [
            "CONTACT",
            "COMPANY",
            "OPPORTUNITY",
            "CAMPAIGN",
            "CAMPAIGN_MEMBER",
            "CUSTOM_OBJECT"
          ]
        },
        "customObjectId": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "key",
        "objectType"
      ]
    }
  }
}