You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the discussion at #16 and cut and paste the sample code mentioned in the stackoverflow (see below), I expect the cloned value is in wrapped format, but turns out it is still unwrapped?! Do I miss something?
It's because 5.0 changed the default wrapping behavior when parsing types: unions are now only represented wrapped where needed.
clone's wrapUnions option only takes effect when the underlying union is wrapped which isn't the case above since ["null", "string"] isn't ambiguous (take a look at the union types for a bit more information).
You can still force wrapping by explicitly setting parse's wrapUnions option though; here's a type that'll make your example work as expected:
Following the discussion at #16 and cut and paste the sample code mentioned in the stackoverflow (see below), I expect the cloned value is in wrapped format, but turns out it is still unwrapped?! Do I miss something?
Here's the cut-n-paste from the stackoverflow discussion:
http://stackoverflow.com/questions/33236284/how-to-convert-a-json-object-into-avro-object-if-avro-schema-contains-union-in-i/33622239#33622239
Expected cloned value as wrapped:
But the above code returns unwrapped result?!
The text was updated successfully, but these errors were encountered: