Skip to content

Add embedded struct support with optimized fast path#58

Merged
shamaton merged 2 commits intomainfrom
embedded
Feb 6, 2026
Merged

Add embedded struct support with optimized fast path#58
shamaton merged 2 commits intomainfrom
embedded

Conversation

@shamaton
Copy link
Owner

@shamaton shamaton commented Feb 5, 2026

  • Add a shared field collector that expands embedded structs, resolves name conflicts, and mirrors encoding/json behavior.
  • Update map/array encode/decode (including stream) to use field paths, support embedded pointers, and honor parent omitempty.
  • Add comprehensive tests for embedded structs, tags, ambiguity, and nil pointer cases to align behavior with JSON.

@shamaton shamaton self-assigned this Feb 5, 2026
@shamaton shamaton added the enhancement New feature or request label Feb 5, 2026
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 88.56589% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.36%. Comparing base (f71f5e2) to head (984f35f).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/stream/decoding/struct.go 80.50% 17 Missing and 6 partials ⚠️
internal/decoding/struct.go 83.05% 16 Missing and 4 partials ⚠️
internal/common/common.go 92.59% 5 Missing and 1 partial ⚠️
internal/stream/encoding/struct.go 92.30% 3 Missing and 3 partials ⚠️
internal/encoding/struct.go 96.69% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
- Coverage   99.26%   98.36%   -0.90%     
==========================================
  Files          72       72              
  Lines        5677     6038     +361     
==========================================
+ Hits         5635     5939     +304     
- Misses         29       70      +41     
- Partials       13       29      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shamaton shamaton merged commit 20ba54b into main Feb 6, 2026
20 checks passed
@shamaton shamaton mentioned this pull request Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant