BUG-973: fixed (de)serialization of union type.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
Merge "BUG-973: fixed (de)serialization of union type."