Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserializer does not throw exceptions if fields are missing #97

Open
deewar opened this issue Jul 27, 2020 · 1 comment
Open

Deserializer does not throw exceptions if fields are missing #97

deewar opened this issue Jul 27, 2020 · 1 comment

Comments

@deewar
Copy link

deewar commented Jul 27, 2020

Hey,

https://github.com/palantir/conjure-python-client/blob/develop/conjure_python_client/_serde/decoder.py#L50

if the field is missing from the object in the line above instead of throwing exceptions, we call check_null_field which in turn just creates an {} for the field instead of throwing an error.

I could not figure out how optional fields are meant to work here so did not PR but to me it sounds like if it anything but an optional we should throw an exception.

Will PR a fix that i think will work but not sure.

@deewar
Copy link
Author

deewar commented Jul 27, 2020

https://palantir.github.io/conjure/#/docs/spec/wire?id=_561-coercing-json-null-absent-to-conjure-types appears to be the answer but this has a terrible ux especially when a small typo can have a wildly different response to what I was expecting
https://palantir.github.io/conjure/#/docs/spec/wire?id=_561-coercing-json-null-absent-to-conjure-types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant