Required and absent values

Why a field that could not be read stays absent rather than becoming zero, and how to tell “the total is zero” from “we could not read the total”.

In document extraction, a missing value is not the same as a zero or empty value. Ovrin treats this difference as part of the API contract.

Why this matters

For data records such as totals, amounts, or identifiers, a zero is a valid value in some contexts while a missing value may mean the value was never detected or was too ambiguous to accept.

Result semantics

  • res.Valid is about whether the extracted result passed validation rules
  • err != nil means the extraction could not produce a usable result
  • some fields may be absent even while the outer result is still meaningful

Design principle

Being explicit about missing values prevents silent data corruption and supports safer downstream processing.