Skip to main content

Module contract

Module contract 

Source
Expand description

This crate’s own claim about the types it declares.

Every type this crate declares as its own is listed in declared, with the JSON Schema it emits and a canonical value of it. This is what the printobserver-types:schemas graph target generates the checked-in schemas from, and what this crate’s contract tests walk, so that a type cannot fall out of the schema set or out of the round-trip corpus by being forgotten in a list somebody maintains by hand.

Each entry carries two values rather than one: full, which carries every field the type declares, and minimal, which carries every optional field absent. The second is what proves that an absent optional serializes as absent rather than as null, a zero or an empty string.

Structs§

TypeContract
One type this crate declares, with its schema and its canonical values.
WireField
One field as a generated schema declares it.

Constants§

EVENT_KIND_MARKER
The member an event payload’s schema carries naming the kind it is under.

Traits§

Sample
A canonical value of one type, for the schema set and the round-trip corpus.

Functions§

declared
Every type this crate declares as its own.
event_schema_of
The JSON Schema one event payload emits, marked with the kind it is under.
schema_of
The JSON Schema one type emits, under this crate’s own generator settings.
wire_fields
Every field one generated schema declares, in name order.