Expand description
Injectable input interface — JSON Schema generation (CLOACI-I-0128).
Canonical home for turning a Rust type into a JSON Schema descriptor and for
the InputSlot contract. Lives in cloacina-workflow (not core cloacina)
because the #[workflow(params(...))] macro emits calls to these helpers into
packaged cdylibs, which depend on cloacina-workflow, not core. Core
cloacina re-exports this module.
Spec: [CLOACI-S-0013]; descriptor decision: [CLOACI-A-0007] (JSON Schema via
schemars).
Structs§
- Input
Slot - One declared input slot of an injectable surface: a named, typed value the
surface accepts.
schemais a JSON Schema fragment (the type descriptor —schemars-derived for Rust, type-hint-derived for Python) that the UI can render a form from and the server can validate an injection against. - Schema
Probe - Opt-in schema derivation for accumulator/reactor boundary types (CLOACI-I-0128 Task D).
Traits§
- Probe
Fallback - Fallback arm of the probe: selected for any
T(one autoref on a&SchemaProbe<T>receiver), yielding a permissive “any” schema. Method resolution prefersProbeTypedwhenever itsT: JsonSchemabound holds. - Probe
Typed - Specific arm of the probe: selected when
T: JsonSchema(zero autorefs on a&SchemaProbe<T>receiver), yielding the real derived schema.
Functions§
- default_
json - Serialize a default value to
serde_json::Valuefor anInputSlot::default. ReturnsNoneif the value can’t serialize. - schema_
for - Generate a JSON Schema for
Tas aserde_json::Value. - slots_
to_ json - Serialize a slot list to the JSON array string carried across the FFI
descriptor entrypoint (
InputInterfaceEntry::slots_json). Falls back to an empty array on serialization failure.