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

Fix typed nil hook support #15

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

Conversation

adriansmares
Copy link

@adriansmares adriansmares commented Feb 28, 2024

References mitchellh#278

Typed nils which are the result of a type decoding hook seem to result in incorrect decoding behavior. Specifically, the nil is turned into an actual value due to the way the nil check works, instead of preserving the nil. Previously we were returning just untyped nils but ever since mitchellh#205 this seems to no longer be supported while chaining multiple hooks.

I've added a test which reproduces this issue, and a possible fix. Please also take a look at the comments in the original PR.

@adriansmares adriansmares changed the title Fix/typed nil hook Fix typed nil hook support Feb 28, 2024
@adriansmares adriansmares marked this pull request as ready for review February 28, 2024 18:28
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.

None yet

1 participant