Skip to main content

Overview

This example demonstrates extraction using ONLY arrays - no PHP classes, no serialization, no deserialization. Just JSON Schema definition and array output. This is useful when:
  • Working with dynamic schemas defined at runtime
  • Avoiding class creation overhead
  • Integrating with systems that expect plain arrays
  • Building schema-driven extraction pipelines

Example

Expected Output

How It Works

  1. Schema definition: JsonSchema fluent API defines the expected structure
  2. No PHP classes: No Article class, no @var annotations, no type hints
  3. intoArray(): Forces output to be plain PHP array
  4. Result: Pure associative array with primitive values

JsonSchema API

Use Cases

  • Dynamic schemas: Define extraction shapes at runtime
  • API-driven extraction: Schema comes from external API/database
  • No-class pipelines: Avoid PHP class overhead entirely
  • Array-first architectures: When your system expects arrays throughout