From aae2d8b66c65627c4bc125eee1162959606e4b3e Mon Sep 17 00:00:00 2001 From: WaleedH <42546485+WaleedHU@users.noreply.github.com> Date: Wed, 5 Aug 2026 16:55:36 +0300 Subject: [PATCH] fix(vertex_ai): satisfy recursion and type discipline gates for oneOf helper --- litellm/llms/vertex_ai/common_utils.py | 2 +- tests/code_coverage_tests/recursive_detector.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/llms/vertex_ai/common_utils.py b/litellm/llms/vertex_ai/common_utils.py index c731ced1263..560810f3486 100644 --- a/litellm/llms/vertex_ai/common_utils.py +++ b/litellm/llms/vertex_ai/common_utils.py @@ -820,7 +820,7 @@ def convert_anyof_null_to_nullable(schema, depth=0): anyof: Final = schema.get("anyOf", None) if anyof is not None: contains_null = False - for atype in list(anyof): + for atype in tuple(anyof): if isinstance(atype, dict) and atype.get("type") == "null": # remove null type anyof.remove(atype) diff --git a/tests/code_coverage_tests/recursive_detector.py b/tests/code_coverage_tests/recursive_detector.py index 244e17b46a1..9c871b54802 100644 --- a/tests/code_coverage_tests/recursive_detector.py +++ b/tests/code_coverage_tests/recursive_detector.py @@ -11,6 +11,7 @@ IGNORE_FUNCTIONS = [ "clean_message", "unpack_defs", "convert_anyof_null_to_nullable", # has a set max depth + "_convert_oneof_to_anyof", # has a set max depth "add_object_type", "strip_field", "_transform_prompt",