Skip to main content

Module example_generators

Module example_generators 

Source
Expand description

Example generators for schema validation

This module provides constructors for generating minimal and full examples of xchecker’s JSON output formats (receipt, status, doctor). These examples are used for schema validation and documentation.

All examples use:

  • Fixed timestamps for deterministic output
  • BTreeMap for deterministic key ordering
  • Sorted arrays (by path for outputs/artifacts, by name for checks)
  • Pinned tool versions for byte-identical assertions

Functions§

fixed_now
Fixed timestamp for deterministic examples Only available in test builds to avoid accidental use in production
make_example_doctor_full
Generate full doctor example (all check types)
make_example_doctor_minimal
Generate minimal doctor example (basic checks)
make_example_receipt_full
Generate full receipt example (all fields populated) Uses BTreeMap for flags and sorts arrays for deterministic output
make_example_receipt_minimal
Generate minimal receipt example (required fields only) Uses fixed timestamp for deterministic output
make_example_status_full
Generate full status example (all fields populated)
make_example_status_minimal
Generate minimal status example (required fields only)