Skip to main content

transform_schema

Function transform_schema 

Source
pub fn transform_schema(schema: &str) -> String
Expand description

Transform a JSON Schema string for Claude CLI compatibility.

Parses the schema, applies all transformations, and re-serializes. Returns the original string unchanged if parsing fails.

ยงExamples

use ironflow_core::schema_transform::transform_schema;

let schema = r#"{"type":"object","properties":{"x":{"type":"integer"}}}"#;
let result = transform_schema(schema);
assert!(result.contains(r#""additionalProperties":false"#));