Skip to content

Commit 2d9ea0d

Browse files
conradleeclaude
andcommitted
Remove simplify_nullable_unions - Google supports type: 'null' natively
The November 2025 announcement explicitly states that Google now supports 'type: null' in JSON schemas, so we don't need to convert anyOf with null to the OpenAPI 3.0 'nullable: true' format. Keep __init__ method for documentation purposes to explicitly note why we're using the defaults (native support for $ref and type: null). Addresses reviewer question: "Do we still need simplify_nullable_unions? type: 'null' is now supported natively" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 3e07326 commit 2d9ea0d

File tree

1 file changed

+5
-0
lines changed
  • pydantic_ai_slim/pydantic_ai/profiles

1 file changed

+5
-0
lines changed

pydantic_ai_slim/pydantic_ai/profiles/google.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class GoogleJsonSchemaTransformer(JsonSchemaTransformer):
2222
Gemini supports [a subset of OpenAPI v3.0.3](https://ai.google.dev/gemini-api/docs/function-calling#function_declarations).
2323
"""
2424

25+
def __init__(self, schema: JsonSchema, *, strict: bool | None = None):
26+
# prefer_inlined_defs defaults to False (native $ref/$defs support)
27+
# simplify_nullable_unions defaults to False (Google now supports type: 'null' natively per Nov 2025 announcement)
28+
super().__init__(schema, strict=strict)
29+
2530
def transform(self, schema: JsonSchema) -> JsonSchema:
2631
# Remove properties not supported by Gemini
2732
schema.pop('$schema', None)

0 commit comments

Comments
 (0)