client-nodejs
client-nodejs copied to clipboard
Normalization of a custom field fails with null values
Hi! We encountered an issue with null values in custom fields, while doing Create or Update requests to API through the client.
Request body with a null value in a custom field
{ "5eadaf49cdc5869afabd486099553698a7096dd0":null}
is being "normalized" to
{"5eadaf49cdc5869afabd486099553698a7096dd0": "5eadaf49cdc5869afabd486099553698a7096dd0"}
converting the null value to a string, containing the key.
The issue seems to be in replaceCamelCaseObj
function, where null
value is considered to be an object, and therefore key
is used as a value, instead of keyValue
.
if (isHash) {
snakeCased[key] = isObject ? key : keyValue;
}