## The problem

Passing a boolean value in a field typed as a union, like the attributes map on CreateContactRequest, throws: Cannot serialize value of type boolean with any of the union types: float | string | bool | array. In src/Core/Json/JsonSerializer.php, serializeSingleValue() matches values against union type strings with gettype($data) === $type, but PHP gettype() returns "boolean" for bools, never "bool", so the check always fails even though bool is a valid union member. The same bug pattern existed for floats (gettype returns "double", not "float") and already had an explicit workaround in the serializer.

## The fix

This is a serializer bug in the v4 SDK: it never matched "bool" against gettype()'s "boolean". It was fixed in v4.0.10, which adds an explicit is_bool() check in JsonSerializer.php mirroring the existing is_float() workaround. Upgrade with composer require getbrevo/brevo-php:^4.0.10 and boolean values in union-typed fields serialize correctly. The fix was contributed via PR #105 on the issue thread and confirmed by the Brevo team.