Yeah, that is an unhandsome solution, let's say :p
But I can understand this is a workaround caused by the limitations of the platform
Even though is not ideal, json serialization + javascript json.parse() it's an acceptable one, because we can discard default values and those would be undefined in js.
Also tried with the conversion to object data type, something like:
client action inputs:
some_input_int (int)
js input:
some_input_obj (object)
js assignment:
some_input_obj = if(some_input_int <> NullIdentifier(), ToObject(some_input), NullObject())
If you don't pass anything (NullIdentifier()) it would be null, as expected, but if you pass 0 it would be null as well, and that's a problem.
I think there shouldn't exist a equivalence relation between 0 and NullIdentifier(), in some cases NullIdentifier() could be interpreted as 0, but 0 shouldn't be equal to NullIdentifier() when making a comparison, but that's another discussion...