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

Better error handling for resolution fail of null union case #11

Open
teabot opened this issue Feb 1, 2018 · 0 comments
Open

Better error handling for resolution fail of null union case #11

teabot opened this issue Feb 1, 2018 · 0 comments

Comments

@teabot
Copy link
Contributor

teabot commented Feb 1, 2018

Most of the unions we see are of the specific 'nullable type' case: [null, T]. When we fail to find a union branch that matches T we give a fairly generic error:

Caused by: com.hotels.jasvorno.JasvornoConverterException: Cannot resolve union: ...

However, in this specific case we really have only one candidate type that happens to be nullable. Therefore it would be really useful to see why the value does not match T, just as if we were trying to validate against only T (and not a union of T and null).

Providing this error would greatly assist in debugging schemas that have nullable fields, and so is actually not really related to the more general use of the union type.

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