schema-coerce 0.1.0

Coerce LLM JSON values to a simple field-schema: string->int, bool, float; strip wrapper objects; fill defaults. Forgiving structured-output recovery.
Documentation
# schema-coerce

[![crates.io](https://img.shields.io/crates/v/schema-coerce.svg)](https://crates.io/crates/schema-coerce)

Coerce LLM JSON values to a simple field-schema. String→int, `"yes"`→
`true`, unwrap `{"result": {...}}` wrappers, fill missing fields from
defaults.

```rust
use schema_coerce::{coerce, Field, Type};
use serde_json::json;

let schema = vec![
    Field { name: "count", ty: Type::Int, default: None },
    Field { name: "ok", ty: Type::Bool, default: Some(json!(false)) },
];
let raw = json!({ "count": "42", "ok": "yes" });
let fixed = coerce(raw, &schema);
assert_eq!(fixed["count"], json!(42));
```

Pair with `llm-json-repair` (parse) and `json-pluck` (extract). MIT
or Apache-2.0.