Skip to main content

Module convert

Module convert 

Source
Expand description

Conversion between Active Value and JSON / simple map representations

Re-exports§

pub use doc::collect_items;
pub use doc::doc_to_html;
pub use doc::doc_to_man;
pub use doc::doc_to_markdown;
pub use doc::DocItem;
pub use export::value_to_toml_string;
pub use export::value_to_yaml_string;
pub use gen::schema_to_go;
pub use gen::schema_to_json_schema;
pub use gen::schema_to_openapi;
pub use gen::schema_to_rust;
pub use gen::schema_to_typescript;
pub use import::json_text_to_active;
pub use import::json_value_to_active;
pub use import::toml_text_to_active;
pub use import::yaml_text_to_active;

Modules§

doc
Documentation generation: schema + intent + comments → Markdown, searchable HTML, and man pages (C-048, spec/docgen.md). Secret values render redacted in every format (C-036).
export
Export: Active value trees to YAML and TOML (C-046, spec/converters.md). JSON export lives in the parent module and is the canonical mapping both formats derive from, so all three agree on shapes and on secret redaction (***SECRET***).
gen
Typed code generation from Active schemas (C-047, spec/converters.md §7). Reads the module’s schema tree and emits JSON Schema, an OpenAPI fragment, TypeScript interfaces, Go structs, and Rust serde types. Only static literal constraints render — dynamic bounds still validate at runtime but have no static form (documented, never guessed).
import
Import: JSON / YAML / TOML into Active source (C-046, spec/converters.md §4). Best-effort by design: every lossy corner carries a diagnostic, and the emitted source always parses. Redacted "***SECRET***" markers import as plain strings — exports are one-way, never resurrected into live secrets.

Functions§

value_to_json
value_to_pretty_json
value_to_simple_toml
Active brace-style emission (key = value lines plus [table] headers): doubles as the unit round-trip path (every suffix from Unit::suffix() re-parses — see tests/unit_roundtrip.rs), so it stays exactly as is. Real TOML interchange lives in export::value_to_toml_string.