Skip to content

fix: removeNullProperties should not filter out regular arrays#420

Open
mgkimsal wants to merge 1 commit intointuit:masterfrom
mgkimsal:master
Open

fix: removeNullProperties should not filter out regular arrays#420
mgkimsal wants to merge 1 commit intointuit:masterfrom
mgkimsal:master

Conversation

@mgkimsal
Copy link
Copy Markdown

Existing removeNullProperties filtered out standard arrays, causing problems. Specifically, an $invoice object with $customerRef on it (with $customerRef['value']) was filtered out, causing "CustomerRef is missing" validation errors.

I added the count() check to ignore empty array values, which seems in spirit with the 'removeNull' intention.

Adding a test, based on the previously added testThatRemoveNullPropertiesLeavesNonNullValuesInPlace

Existing removeNullProperties filtered out standard arrays, causing problems.  Specifically, an $invoice object with $customerRef on it (with $customerRef['value']) was filtered out, causing "CustomerRef is missing" validation errors.

I added the count() check to ignore empty array values, which seems in spirit with the 'removeNull' intention.

Adding a test, based on the previously added testThatRemoveNullPropertiesLeavesNonNullValuesInPlace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant