Learn

Validation-First Authoring

Author Cuddler content so the data contract and template contract can be validated before anything is rendered.

Pattern

What validation-first authoring enforces

This pattern treats validation as the authoring finish line for each contract, not as an optional check after the fact.

1Validate the data contract

Confirm the data JSON satisfies the Data Schema.

2Validate the render contract

Check the template JSON against the Template Schema on its own.

3Confirm version alignment

Make sure the contracts and references belong to the same release family.

4Render only after both pass

Use rendering as the final output step rather than the debugging step.

The earlier the contract fails, the easier it is to explain and fix.

Validation-first authoring means the document is not considered ready until the data contract has passed and the template contract has passed.

Pattern

  1. Validate the data JSON against the data schema.
  2. Validate the template JSON against the template schema.
  3. Confirm the versions are aligned.
  4. Render only after both checks succeed.

Why It Matters

  • It keeps the data contract and render contract separate.
  • It prevents a template from hiding a bad data model.
  • It makes failures easier to diagnose because the failure happens earlier and in the right place.

Use This When

  • a document family is shared by multiple authors
  • output quality matters more than fast drafting
  • you need predictable behavior in automated pipelines