Skip to content

fix(decoder): reuse original key nodes when decoding inline structs#882

Open
duseo wants to merge 2 commits into
goccy:masterfrom
duseo:fix/issue-844
Open

fix(decoder): reuse original key nodes when decoding inline structs#882
duseo wants to merge 2 commits into
goccy:masterfrom
duseo:fix/issue-844

Conversation

@duseo

@duseo duseo commented May 18, 2026

Copy link
Copy Markdown

Fixes #844

The mapping built for inline structs used tokenless StringNode keys which resulted in the formatter getting empty output.
Reuse the original key nodes from keyToKeyNodeMap so that custom unmarshalers receive data for nested structs.

mapNode.Values is then sorted so the order stays deterministic.

Before submitting your PR, please confirm the following.

  • Describe the purpose for which you created this PR.
  • Create test code that corresponds to the modification

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 53.33333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.59%. Comparing base (edee2f9) to head (c583969).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #882      +/-   ##
==========================================
- Coverage   80.65%   80.59%   -0.07%     
==========================================
  Files          22       22              
  Lines        6845     6859      +14     
==========================================
+ Hits         5521     5528       +7     
- Misses        905      909       +4     
- Partials      419      422       +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@duseo duseo changed the title fix(decoder): fix(decoder): Reuse original key nodes when decoding inline structs May 18, 2026
@duseo duseo changed the title fix(decoder): Reuse original key nodes when decoding inline structs fix(decoder): reuse original key nodes when decoding inline structs May 18, 2026
@duseo duseo marked this pull request as ready for review May 18, 2026 16:00
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.

Custom Unmarshaller's receive no data for nested structs

2 participants