[Bug] fromJson not converting empty strings to null as described

We had an issue at production yesterday where the system tried to access a property inside an empty string.

Looking more closely, we discovered that the a!fromJson is not doing as it was supposed to do.


Here on the a!fromJson (21.1) documentation, we see that the property with an empty string it's converted to null

But when we execute the same code on the expressions, this comes back as an empty string, not maintaining its described functionality.

The problem is that when we try to access a property from a null value, it does not throw an error.


But when we try to access a property from a Text it throws an error and we know how problematic those are

  Discussion posts and replies are publicly visible

Parents Reply
  • Yes, it's a nice approach.

    We usually just learn the index function first and as the property does a part of the same job the index does we usually forget about it and use index for everything.

    But for readability, it is much better as it speaks out what it is doing there on the code, getting a property.

    In fact, seems that index is the one that does more stuff "than it should do" looking only by its name.
    Even if some languages have named indexes already, don't know maybe I am being a little old school here hahahahah

    But, thanks for the tip

Children
No Data