File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ def _sanitize_schema_formats_for_gemini(
120120 snake_case_schema [field_name ] = [
121121 _sanitize_schema_formats_for_gemini (value ) for value in field_value
122122 ]
123- elif field_name in dict_schema_field_names :
123+ elif field_name in dict_schema_field_names and field_value is not None :
124124 snake_case_schema [field_name ] = {
125125 key : _sanitize_schema_formats_for_gemini (value )
126126 for key , value in field_value .items ()
Original file line number Diff line number Diff line change @@ -511,6 +511,14 @@ def test_sanitize_schema_formats_for_gemini_nullable(self):
511511 "type" : "object" ,
512512 }
513513
514+ def test_to_gemini_schema_properties_is_none (self ):
515+ """Tests schema conversion when 'properties' field is None."""
516+ openapi_schema = {"type" : "object" , "properties" : None }
517+ gemini_schema = _to_gemini_schema (openapi_schema )
518+ assert isinstance (gemini_schema , Schema )
519+ assert gemini_schema .type == Type .OBJECT
520+ assert gemini_schema .properties is None
521+
514522
515523class TestToSnakeCase :
516524
You can’t perform that action at this time.
0 commit comments