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.
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'sdominantField
does it with field info. Adding the overlapping-field-resolver implementation almost identical to that of the std'sencoding/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.