From 01d8a72585c2580931cc58c35012ef1afe776372 Mon Sep 17 00:00:00 2001 From: Anas Khan <83116240+anxkhn@users.noreply.github.com> Date: Mon, 6 Jul 2026 14:16:36 +0530 Subject: [PATCH] test(adk): assert real tls_insecure_skip_verify tag in omitempty test TestMarshalJSON_OmitemptyFields listed "tls_disable_verify" in the wantAbsent slices for the OpenAI and Anthropic cases, but no Go struct field serializes to that key: the TLS-verify field on BaseModel is tagged tls_insecure_skip_verify. Because the marshaller never emits tls_disable_verify, the absence check was vacuously true and could never fail, leaving the omitempty behavior of the TLS-verify pointer untested (tls_disable_verify is a Python-only legacy alias). Use the actual json tag tls_insecure_skip_verify so the assertion exercises the intended omitempty behavior. Verified by temporarily dropping ,omitempty from the field: the corrected test then fails (the old one still passed), and it passes again once ,omitempty is restored. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com> --- go/api/adk/types_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/api/adk/types_test.go b/go/api/adk/types_test.go index d1d9c8c06b..df53650e6e 100644 --- a/go/api/adk/types_test.go +++ b/go/api/adk/types_test.go @@ -53,12 +53,12 @@ func TestMarshalJSON_OmitemptyFields(t *testing.T) { { name: "OpenAI zero-valued omitempty fields omitted", model: &OpenAI{BaseModel: BaseModel{Model: "gpt-4o"}}, - wantAbsent: []string{"headers", "tls_disable_verify", "tls_ca_cert_path", "tls_disable_system_cas", "api_key_passthrough", "frequency_penalty", "max_tokens", "temperature"}, + wantAbsent: []string{"headers", "tls_insecure_skip_verify", "tls_ca_cert_path", "tls_disable_system_cas", "api_key_passthrough", "frequency_penalty", "max_tokens", "temperature"}, }, { name: "Anthropic zero-valued omitempty fields omitted", model: &Anthropic{BaseModel: BaseModel{Model: "claude-3"}}, - wantAbsent: []string{"headers", "tls_disable_verify", "tls_ca_cert_path", "tls_disable_system_cas", "api_key_passthrough"}, + wantAbsent: []string{"headers", "tls_insecure_skip_verify", "tls_ca_cert_path", "tls_disable_system_cas", "api_key_passthrough"}, }, { name: "Bedrock zero-valued omitempty fields omitted",