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

Improve deepobject unmarshalling to support nullable.Nullable and encode.TextUnmarshaler #45

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

j-waters
Copy link

@j-waters j-waters commented Jun 7, 2024

Fixes #44.

This adjusts deep object unmarshalling to support types that implement encoding.TextUnmarshaler (which fixes the issue with with unmarshalling uuid.UUID, and is an interface that is commonly implemented by other types). I'm aware that the Binder interface exists however most types from common libraries don't/won't implement it.

It also adjust deep object marshalling to support nil types, marshalling them as field=null rather than field=.

Finally, it adds custom unmarshalling for the nullable.Nullable type. I'm not 100% happy with how I've done this, with the nullableLike interface, however because nullable.Nullable is generic it's tricky to use casting/reflection to determine the type.

@j-waters j-waters requested a review from a team as a code owner June 7, 2024 10:24
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

Successfully merging this pull request may close these issues.

Deep object's don't support nullable.Nullable or more complex types like uuid.UUID
1 participant