What's wrong with this entry?
Anonymous. No account, no email.
What: Pass JSON schemas at SDK initialization time for automatic structured output validation. How to use:
# Python SDK example
from claude_code import ClaudeCode
client = ClaudeCode()
response = client.run(
prompt="Generate user data",
json_schema={
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "integer"}
},
"required": ["name", "age"]
}
)
Details:
- Schema is validated using Ajv validator
- Automatically creates a StructuredOutput validation tool
- Validates all outputs against the schema throughout the session
- Works via both SDK initialization and CLI
--json-schemaflag - Evidence:
$D0()at line 2327,$G1()at line 470974 in v2.0.50