I think the problem is very basic,
the error is happening because the JSON structure you send doesn’t match with what the Google Address Validation API wants. The API wants a PostalAddress object where addressLines is array, not a string. But your code is turning the array into a string using String.valueOf(json);