palantir / conjure-python-client

Python client and JSON encoders for use with generated Conjure clients
Apache License 2.0
7 stars 20 forks source link

FR: Handle deserializing unknown union variants gracefully #157

Open gsilvasimoesPT opened 1 month ago

gsilvasimoesPT commented 1 month ago

See https://github.com/palantir/conjure-python-client/issues/129 and https://github.com/palantir/conjure-python-client/pull/150.

It is possible to configure conjure clients to deserialize unknown union variants as null, but this is not the default and clients are surprised with failures when a new variant is introduced in returned types.

Ideally unknown variants should never fail to deserialize (by default, rather than through a config flag), and the generated client's type annotations should inform that they must be handled.