Skip to content

Support odd Codable behaviors#242

Merged
gwynne merged 2 commits into
mainfrom
support-odd-codable-behaviors
Jun 27, 2026
Merged

Support odd Codable behaviors#242
gwynne merged 2 commits into
mainfrom
support-odd-codable-behaviors

Conversation

@gwynne

@gwynne gwynne commented Jun 26, 2026

Copy link
Copy Markdown
Member

These changes are now available in 4.5.2

Currently, LeafEncoder throws a fatal error if one attempts to encode more than one object into the same keyed or unkeyed encoding container. Doing so is incorrect use of the Codable API, but it is nonetheless a semi-common practice, and is also the only practical way to accomplish some things. This change lifts the restriction and allows such encoding to work as expected.

Also bumps the package's Swift version requirement to 6.1 and converts the tests to SwiftTesting.

gwynne added 2 commits June 26, 2026 17:12
…nt objects within the same keyed or unkeyed containers. This is not a correct use of Codable, but it is nonetheless a semi-common one.
@gwynne gwynne added the semver-patch Internal changes only label Jun 26, 2026
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 35.71429% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.34%. Comparing base (42e8274) to head (4681ef7).

Files with missing lines Patch % Lines
Sources/Leaf/LeafEncoder.swift 35.71% 45 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (42e8274) and HEAD (4681ef7). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (42e8274) HEAD (4681ef7)
6 5
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #242      +/-   ##
==========================================
- Coverage   76.95%   67.34%   -9.62%     
==========================================
  Files           5        5              
  Lines         243      297      +54     
==========================================
+ Hits          187      200      +13     
- Misses         56       97      +41     
Files with missing lines Coverage Δ
Sources/Leaf/LeafEncoder.swift 52.43% <35.71%> (-11.69%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MahdiBM MahdiBM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as far as I can tell.

@gwynne gwynne merged commit 21852a8 into main Jun 27, 2026
20 checks passed
@gwynne gwynne deleted the support-odd-codable-behaviors branch June 27, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Internal changes only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants