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(json): improve handling of omitempty with embedded pointers #89

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dominicbarnes
Copy link

This PR fixes #63 by improving the handling of embedded pointers. Not surprisingly, these are a tricky bunch to contend with, so I've included a few test cases to demonstrate the efficacy of this change, but would appreciate some feedback on additional test cases to include.

In short, when passing a value to the "is empty" func, previously we weren't following pointers properly when they were embedded since we failed to track the pointer addresses own offset. This fix still feels kinda janky to me, especially to someone not especially comfortable with dealing with pointers like this, but it seems to get the job done.

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.

Different output when using anonymous fields and omitempty tags
2 participants