Skip to main content

Module render

Module render 

Source
Expand description

Guest-safe canonical schema and value rendering.

Modules§

error
Shared error type for the renderer family.
json_schema
Renderer that produces a JSON Schema document from a SchemaGraph/ SchemaType.
json_value
JSON value renderer: convert a (SchemaGraph, SchemaType, SchemaValue) to and from a serde_json::Value.
openapi
Thin OpenAPI 3.1 adaptor over super::json_schema.
walker
Dynamic walker skeleton operating over (SchemaGraph, SchemaType, SchemaValue).

Structs§

JsonSchemaConfig
Configuration for the JSON Schema renderer.

Enums§

RenderError
Errors produced by the schema/value renderers.
WalkerError
Errors raised by the walk driver. Walker-specific errors are wrapped in WalkerError::Walker.

Traits§

SchemaWalker
Driver-friendly walker over a typed value tree.

Functions§

from_json_value
Decode a serde_json::Value into a value tree typed by ty in graph.
from_untrusted_json_value
Decode externally supplied JSON without allowing it to construct host-managed capabilities. Rejection happens when the selected value path reaches a capability leaf, so absent options and unselected sum-type arms remain valid.
resolve_ref
Resolve any leading SchemaType::Ref hops on ty (cycle-aware) and hand the resulting non-ref body to f. Errors raised by ref handling surface as WalkerError::RefCycle / WalkerError::DanglingRef; the caller’s own error type is wrapped in WalkerError::Walker.
to_external_input_json_schema
Render a JSON Schema for untrusted external input. Host-managed capability leaves cannot be constructed by callers.
to_external_input_openapi_components
Render a schema bundle for untrusted external input.
to_external_output_json_schema
Render a JSON Schema for externally visible output. Host-managed capability leaves expose only their redacted placeholders.
to_external_output_openapi_components
Render a schema bundle for externally visible output.
to_json_schema
Render (graph, ty) to a canonical JSON Schema document (includes the $schema draft marker). See to_json_schema_with_config for the configurable form.
to_json_schema_with_config
Render (graph, ty) to a JSON Schema document. When ty is a Ref(TypeId) the document is { "$defs": {…}, "$ref": "#/$defs/<id>" }; otherwise the root schema is emitted inline with $defs carrying every named definition from the graph plus any union per-branch synthesised schemas under tag-derived keys (see [BranchNameTable]).
to_json_value
Render a value tree to a serde_json::Value.
to_json_value_redacted
Render a value tree to a serde_json::Value, redacting every host-managed capability node (see HostManagedKind).
to_openapi_components
Render (graph, ty) to an OpenAPI 3.1 schema bundle.
to_reflection_json_schema
Render the JSON domain accepted by reflection pack_json/unpack_json. Capability, future, and stream leaves are unsatisfiable because those adapters have no JSON representation for them.
walk
Drive a walker over (graph, ty, value).