Skip to content

[$50] Don't apply "clearObject" method and remove it #119

@maxceem

Description

@maxceem

Currently, we are applying method "helper.clearObject" to all the responses.

This method:

  • Transforms response = null to undefined (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 (actually null 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions