Expand description
Build-time generation from specs/src, for the build scripts of the crates that embed or type the spec: the documents bundled whole, and Rust types from their component schemas. One generator, so the SDK’s protocol types and a service’s own types cannot be generated two ways.
Modules§
- bundle
- Bundling specs/src into whole documents: every file
$reffollowed, each file the root document lists undercomponentsnamed by its component and the rest inlined, as the published bundles are, and the component schemas as JSON Schema draft 7. - types
- Rust types from component schemas (JSON Schema draft 7, as
draft7_definitionswrites them): a struct per object, an enum per string enumeration, an untagged enum peroneOforanyOf, an alias per named string, a type of its own per kind of id, a field per property, optional where the schema does not require it. It knows the shapes the spec’s schemas use and refuses any other, so a schema that grows a new shape fails the build rather than generating something wrong.