Tools•formatter
JSON Schema Sanitizer for Structured Output
Prepare JSON Schema for stricter structured-output APIs by removing unsupported fields and normalizing common incompatibilities.
Try the tool
client runnerSanitized schema JSON
Run the tool to see output.
Examples
Remove unsupported metadata and const
{
"schema_json": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"kind\":{\"const\":\"guide\"}},\"additionalProperties\":false}",
"remove_additional_properties": true,
"convert_const_to_enum": true,
"strip_meta_keywords": true
}Expected output
{"type":"object","properties":{"kind":{"enum":["guide"]}}}Only normalize const to enum
{
"schema_json": "{\"type\":\"object\",\"properties\":{\"status\":{\"const\":\"ok\"}}}",
"remove_additional_properties": false,
"convert_const_to_enum": true,
"strip_meta_keywords": false
}Expected output
{"type":"object","properties":{"status":{"enum":["ok"]}}}How it works
The tool parses your schema, walks nested objects, and applies deterministic transforms selected by toggles. Use it before calling structured-output APIs to reduce schema rejection and improve response consistency.