Skip to main content

Overview

We use JSON Schema to define the structure of extracted data.

Rules

  • Root must be an object type
  • Allowed types: string, number, integer, boolean, object, array
  • Primitive fields must be nullable: "type": ["string", "null"]
  • Maximum nesting level: 3
  • Array items: objects or primitives (string, number, integer, boolean)
  • Enums: strings only, must include null
  • Use description fields to provide context
  • Date values should use "custom:type": "date" on string fields
  • Validation rules should be modeled as a boolean field with beltic:validation and a sibling field_ref

Unsupported Features

  • Schema composition (anyOf, oneOf, allOf)
  • Regular expressions
  • Conditional validation
  • Constant values

Examples

Basic Schema

With Nested Objects

With Arrays

With Enums

Validation Fields (Date Reference)

Date validations are configured on a boolean field, not on the date field itself. Use this pattern:
  • Source date field: type: ["string", "null"] + "custom:type": "date"
  • Validation field: type: ["boolean", "null"] + beltic:validation
  • field_ref must point to a sibling date field name in the same scope

Validation Fields in Nested Objects/Arrays

field_ref is scope-relative:
  • Inside an object, it references a field in that same object
  • Inside an array item object, it references a field in each item