Skip to main content

bijux_cli/contracts/
schema.rs

1//! JSON schema generation helpers for durable contract types.
2
3use schemars::schema::RootSchema;
4use schemars::schema_for;
5
6use crate::contracts::{ErrorEnvelopeV1, OutputEnvelopeV1, PluginManifestV2};
7
8/// Build a JSON Schema for `OutputEnvelopeV1`.
9#[must_use]
10pub fn output_envelope_v1_schema() -> RootSchema {
11    schema_for!(OutputEnvelopeV1)
12}
13
14/// Build a JSON Schema for `ErrorEnvelopeV1`.
15#[must_use]
16pub fn error_envelope_v1_schema() -> RootSchema {
17    schema_for!(ErrorEnvelopeV1)
18}
19
20/// Build a JSON Schema for `PluginManifestV2`.
21#[must_use]
22pub fn plugin_manifest_v2_schema() -> RootSchema {
23    schema_for!(PluginManifestV2)
24}