← All docs

Guides

Schemas

What a schema can describe, and how each type comes back.

Tolva reads the subset of JSON Schema that describes data: objects, arrays, strings, numbers, booleans, enums and dates.

Required fields

A required field that can’t be found is returned as null and put in review. It never fails the request, so one missing value doesn’t lose the rest.

Arrays

Line items and table rows are arrays of objects. Each cell carries its own confidence.

invoice.schema.json

{
  "type": "object",
  "properties": {
    "total": { "type": "number" },
    "due": { "type": "string", "format": "date" },
    "vat_id": { "type": "string" },
    "currency": { "enum": ["EUR", "GBP", "USD"] }
  },
  "required": ["total", "due"]
}