Skip to main content

Module schema

Module schema 

Source
Expand description

Payload typing: what values a payload type may carry, and what the specification says it means.

The Alliance publishes six enumeration files as JSON Schema; cargo xtask codegen compiles them into this module, and CI fails when the pinned files and the table differ. Four describe a valuesMap — event interval payloads, report payloads, programme attributes, VEN and resource attributes — and become PayloadSpecs keyed by PayloadGroup. Two constrain a descriptor field and become units and reading_types.

Each PayloadSpec::description is the definition’s own text, so a converter can refuse a payload in the specification’s words. The enumeration files are © OpenADR Alliance, released under the Apache License 2.0.

Validation is not mandatory: the Definitions leave content validation to the client, and private payload types are legal. An unknown type is Validity::Unknown, never an error, and a VTN chooses its own Policy.

Structs§

PayloadSpec
What the specification says about one payload type.
ValueKinds
The set of JSON value kinds a payload accepts, as a bit set.

Enums§

PayloadGroup
Which family a payload type belongs to.
PayloadViolation
A single way in which a payload contradicts its specification.
Policy
How strictly a VTN enforces payload typing.
Validity
The outcome of checking a payload.

Functions§

all
Every known payload specification.
lookup
Look up a payload type by name.
reading_types
Every reading type reportPayloadDescriptor.readingType enumerates.
subinterval_count
How many sub-intervals a payload implies.
units
Every unit of measure eventPayloadDescriptor.units enumerates.
validate
Check one payload against its specification.
validate_all
Check a list of payloads, collecting every violation.