Notice that binary deserializer (readArrayOfConditions) does it correctly. Can be checked with neo-project/neo#2720 case.
See neo-project/neo#2622. The implementation is somewhat asymmetric (and not very efficient) for binary/JSON encoding/decoding, but it should be sufficient.