-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Milestone
Description
Currently, we are applying method "helper.clearObject" to all the responses.
This method:
- Transforms
response = null
toundefined
(why?) - If the response is an array, then it removes all the
null
values form the array (I guess this might hide some issue in the logic which creates this array) - If response is object and has fields with
null
or[]
fields, it removes such fields (actuallynull
means that we have the field but without value, while no field, means field doesn't exists. Also, returning[]
makes it easier on the client side, as we can count that value is array and we can work with it like array)
In general this method feels like make the responses less unified.
So I don't see benefits from such clearing, while see some drawbacks and suggest to remove this method, and don't apply it to responses.
We have to make sure that the code didn't got broken after removing it.
If someone knows any benefits of this method, please, let me know.