gives a correct value.
It’s not easy to remove a field from a structure in language like Java, so it would be interesting to consider empty or null value for object field as absence of it.
But then there shouldn’t be an issue to just leave the object field out? You can just remove it from your Java struct and encode it to JSON without the object field being present.
Yes, I’ve managed it, it’s not a blocking issue but it’s more a strange behavior, eventually it should return an error of the best would be to get the data field when object is empty.