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 #657 incorrect encoding of embedded-recursive types and overlapping tags #659

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

Conversation

ngicks
Copy link

@ngicks ngicks commented Feb 18, 2023

Just to explore how to fix #657 .

A simple fix to recursive embedded types is to add recursion check.
This, however, breaks other test cases.

I found that it is hard to fix the problem by changing the current resolveConflictBinding implementation, because it does it without field information, while Go's dominantField does it with field info.
Adding the overlapping-field-resolver implementation almost identical to that of the std's encoding/json, of course, fixes the problem.

This PR introduces significant changes to the code base (at least it's not like 50 lines fix).
So this might not be suitable for the goal of this library.

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.

Recursive struct type causes stack overflow / Handling of overlapping field tagged name is not aligned to std
1 participant