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

Add option to return none on unknown union variants #150

Closed markgrex closed 1 year ago

markgrex commented 1 year ago

Before this PR

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

After this PR

This PR adds a flag, that when set to true, changes the deserialization behavior to to return None instead of throwing an exception on encountering an unknown union variant. This flag is optional, and is set to false by default.

Once this PR merges, we can update the code generation in conjure-python to pass through this flag to ConjureDecoder.

==COMMIT_MSG== Add option to return none on unknown union variants ==COMMIT_MSG==

Possible downsides?

changelog-app[bot] commented 1 year ago

Generate changelog in changelog-dir>`changelog/@unreleased`</changelog-dir

Type

- [ ] Feature - [x] Improvement - [ ] Fix - [ ] Break - [ ] Deprecation - [ ] Manual task - [ ] Migration

Description

Add option to return none instead of throwing when deserializing unknown union variants **Check the box to generate changelog(s)** - [x] Generate changelog entry
johnhany97 commented 1 year ago

👍

svc-autorelease commented 1 year ago

Released 2.8.0