{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudmersive/json-schema/cloudmersive-form-recognition-result-schema.json",
  "title": "FormRecognitionResult",
  "description": "The result of extracting form field values",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudmersive-imageocr-api-openapi.yml#/components/schemas/FormRecognitionResult",
  "type": "object",
  "properties": {
    "Successful": {
      "description": "True if the operation was successful, false otherwise",
      "type": "boolean"
    },
    "FieldValueExtractionResult": {
      "description": "Result of form field OCR data extraction",
      "type": "array",
      "items": {
        "$ref": "#/$defs/FieldResult"
      }
    },
    "TableValueExtractionResults": {
      "description": "Result of form table OCR data extraction",
      "type": "array",
      "items": {
        "$ref": "#/$defs/TableResult"
      }
    },
    "Diagnostics": {
      "description": "Diagnostic images - default is null, enable diagnostics=true to populate this parameter with one image per field",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "BestMatchFormSettingName": {
      "description": "Optional; populated when using photo/recognize/form/advanced with the Setting Name of the best-matching highest-relevance form",
      "type": "string"
    }
  },
  "$defs": {
    "FieldResult": {
      "description": "A pairing target field and actual value read from form",
      "type": "object",
      "properties": {
        "TargetField": {
          "$ref": "#/$defs/FormFieldDefinition",
          "description": "Target field to extract from the form"
        },
        "FieldValues": {
          "description": "Result field value(s) extracted",
          "type": "array",
          "items": {
            "$ref": "#/$defs/OcrPhotoTextElement"
          }
        }
      }
    },
    "FormFieldDefinition": {
      "description": "Definition of a form field for OCR data extraction from images",
      "type": "object",
      "properties": {
        "FieldID": {
          "description": "The identifier of the field; use this to identify which field is being referenced.  Set to SkipField if you do not wish to return the value of this field in the result.",
          "type": "string"
        },
        "LeftAnchor": {
          "description": "Optional - the left-hand anchor of the field",
          "type": "string"
        },
        "TopAnchor": {
          "description": "Optional - the top anchor of the field",
          "type": "string"
        },
        "BottomAnchor": {
          "description": "Optional - the bottom anchor of the field",
          "type": "string"
        },
        "AlternateAnchor": {
          "description": "Optional - alterate match text for the specified anchor",
          "type": "string"
        },
        "AnchorMode": {
          "description": "Optional - the matching mode for the anchor.  Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally).  Default is Partial.",
          "type": "string"
        },
        "DataType": {
          "description": "The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace)",
          "type": "string"
        },
        "TargetDigitCount": {
          "format": "int32",
          "description": "Optional - the target number of digits in the field; useful for fixed-length fields",
          "type": "integer"
        },
        "MinimumCharacterCount": {
          "format": "int32",
          "description": "Optional - the target number of digits in the field; useful for fixed-length fields",
          "type": "integer"
        },
        "AllowNumericDigits": {
          "description": "Optional - set to false to block values that contain numeric digits, set to true to allow numeric digits",
          "type": "boolean"
        },
        "VerticalAlignmentType": {
          "description": "Vertical alignment of target value area relative to the field anchor; Possible values are VCenter, Top, Bottom",
          "type": "string"
        },
        "HorizontalAlignmentType": {
          "description": "Horizontal alignment of target value area relative to the field anchor; Possible values are Left, Right",
          "type": "string"
        },
        "TargetFieldWidth_Relative": {
          "format": "double",
          "description": "Optional - scale factor for target field width - relative to width of field title; a value of 1.0 indicates the target value area has the same width as the field value as occurring in the image; a value of 2.0 would indicate that the target value area has 2 times the width of the field value as occurring in the image.",
          "type": "number"
        },
        "TargetFieldHeight_Relative": {
          "format": "double",
          "description": "Optional - scale factor for target field height - relative to height of field title",
          "type": "number"
        },
        "TargetFieldHorizontalAdjustment": {
          "format": "double",
          "description": "Optional - horizontal adjestment in relative width of the field",
          "type": "number"
        },
        "TargetFieldVerticalAdjustment": {
          "format": "double",
          "description": "Optional - vertical adjestment in relative height of the field",
          "type": "number"
        },
        "Ignore": {
          "description": "Optional - Ignore any result items that contain a partial or complete match with these text strings",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "Options": {
          "description": "Optional - additional options that can be set for this field definition, separated by commas.  Possible values are AllowMultiMatch (allow the same anchor to be matched to multiple fields)",
          "type": "string"
        }
      }
    },
    "FormTableColumnDefinition": {
      "description": "Definition of a column within a table for OCR data extraction from images",
      "type": "object",
      "properties": {
        "ColumnID": {
          "description": "The identifier of the field; use this to identify which field is being referenced",
          "type": "string"
        },
        "TopAnchor": {
          "description": "Optional - the top anchor of the column heading",
          "type": "string"
        },
        "AnchorMode": {
          "description": "Optional - the matching mode for the anchor.  Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match).  Default is Partial.",
          "type": "string"
        },
        "DataType": {
          "description": "The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace)",
          "type": "string"
        },
        "MinimumCharacterCount": {
          "format": "int32",
          "description": "Optional - the target number of digits in the field; useful for fixed-length fields",
          "type": "integer"
        },
        "AllowNumericDigits": {
          "description": "Optional - set to false to block values that contain numeric digits, set to true to allow numeric digits",
          "type": "boolean"
        }
      }
    },
    "FormTableDefinition": {
      "description": "Definition of a form table for OCR data extraction from images",
      "type": "object",
      "properties": {
        "TableID": {
          "description": "Optional; the ID of the table",
          "type": "string"
        },
        "ColumnDefinitions": {
          "description": "Definition of the columns in the table",
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormTableColumnDefinition"
          }
        },
        "TargetTableHeight_Relative": {
          "format": "double",
          "description": "Optional - scale factor for target table height - relative to maximum height of headers of columns",
          "type": "number"
        },
        "TargetRowHeight_Relative": {
          "format": "double",
          "description": "Optional - scale factor for target row height - relative to height of column header",
          "type": "number"
        }
      }
    },
    "OcrPhotoTextElement": {
      "description": "A single text in an OCR document",
      "type": "object",
      "properties": {
        "Text": {
          "description": "Text of the word",
          "type": "string"
        },
        "XLeft": {
          "format": "int32",
          "description": "X location of the left edge of the word in pixels",
          "type": "integer"
        },
        "YTop": {
          "format": "int32",
          "description": "Y location of the top edge of the word in pixels",
          "type": "integer"
        },
        "Width": {
          "format": "int32",
          "description": "Width of the word in pixels",
          "type": "integer"
        },
        "Height": {
          "format": "int32",
          "description": "Height of the word in pixels",
          "type": "integer"
        },
        "BoundingPoints": {
          "description": "Points that form the bounding polygon around the text",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Point"
          }
        },
        "ConfidenceLevel": {
          "format": "double",
          "description": "Confidence level of the machine learning result; possible values are 0.0 (lowest accuracy) - 1.0 (highest accuracy)",
          "type": "number"
        }
      }
    },
    "Point": {
      "description": "Point location in 2D in an image, where 0, 0 represents the top/left corner of the image",
      "type": "object",
      "properties": {
        "X": {
          "format": "int32",
          "description": "X location in 2D in the image, where 0 represents the left edge of the image",
          "type": "integer"
        },
        "Y": {
          "format": "int32",
          "description": "Y location in 2D in the image, where 0 represents the top edge of the image",
          "type": "integer"
        }
      }
    },
    "TableCellResult": {
      "description": "The recognition result of one cell in one row in a table of a form",
      "type": "object",
      "properties": {
        "ColumnID": {
          "description": "The ID of the column",
          "type": "string"
        },
        "CellValues": {
          "description": "Result cell value(s) extracted",
          "type": "array",
          "items": {
            "$ref": "#/$defs/OcrPhotoTextElement"
          }
        }
      }
    },
    "TableResult": {
      "description": "The result of reading a table via OCR from a form",
      "type": "object",
      "properties": {
        "TableDefinition": {
          "$ref": "#/$defs/FormTableDefinition",
          "description": "The input table definition for reference"
        },
        "TableRowsResult": {
          "description": "Rows of data in the table",
          "type": "array",
          "items": {
            "$ref": "#/$defs/TableRowResult"
          }
        }
      }
    },
    "TableRowResult": {
      "description": "One row of data in the resulting table",
      "type": "object",
      "properties": {
        "TableRowCellsResult": {
          "description": "Table cells in this row result",
          "type": "array",
          "items": {
            "$ref": "#/$defs/TableCellResult"
          }
        }
      }
    }
  }
}