# Schemas and validation

Validate primitive types, enums, timestamps, and relationships with explicit positive and negative examples.

Waypoint Reference · Version 2026.10.3

All network records are synthetic examples.

## Validate rows, then relationships

Each dataset's schema property is a JSON Schema 2020-12 document for one record, not the enclosing resource document. It declares required properties, allowed values, numeric bounds, and additionalProperties: false.

Enable date-time format validation in your validator. POST /api/v1/fixtures/validate checks rows against these fixed schemas and returns at most ten errors without echoing supplied values. Records are processed transiently, not stored. Schema validation alone cannot resolve foreign keys or enforce lifecycle order; perform those checks after every row passes.

## A valid station

This row satisfies the waypoint schema. synthetic must be the boolean true, and capacity must be a non-negative integer.

```text
{
  "id": "wp-001",
  "name": "Alder Station",
  "region": "north",
  "status": "ready",
  "capacity": 120,
  "timezone": "UTC",
  "synthetic": true
}
```

## Useful negative cases

Starting from that valid row, replacing capacity with the string "120" must fail. A capacity of -1 must fail. Replacing status with "online" must fail. Removing id or adding an undeclared credential field must fail.

Likewise, a syntactically valid wp-999 reference in a batch can pass a row schema but fail catalog integrity because no station with that ID exists. Keep syntax and relationship failures separate in your test output.

## Catalog integrity checklist

Require unique IDs within each dataset and matching versions across documents. Every batch source_id and destination_id must resolve to a different station. Every event batch_id must resolve to a batch, and its waypoint_id must match the correct endpoint for that stage.

Per batch, sequence starts at 1 and has no gaps or duplicates. Timestamps increase, event units match batch units, and the final event agrees with the batch's state. These deterministic fixtures contain examples of queued, in-transit, and completed lifecycles.
