Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.0.50 ·

JSON Schema Support in SDK Initialization

Entry
JSON All of v2.0.50
EntryKind: in v2.0.50,
ChangesSection of the release

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-schema flag
  • Evidence: $D0() at line 2327, $G1() at line 470974 in v2.0.50

See this entry in the whole of v2.0.50 →

Feedback