-
Notifications
You must be signed in to change notification settings - Fork 161
feat: support DecodableWithConfiguration #460
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
Conversation
Thank you for this valuable contribution. If we can address the build errors on non-apple platforms, I’d love to merge it. I’ll give a detailed read to the changes after the builds are green. :) |
4395324
to
2399bda
Compare
Tried to fix the failing Action. Suggested fix: actions/runner-images#12912 (comment) But GHA team says that the new image rollout with the fix is soon: actions/runner-images#12912 (comment) And I'm not sure if ninja is affected too 🤷 |
Thanks for trying to fix the GH runner issue. Let's let GHA team handle that. Preferably, you'd address the swift compilation error in the tests. FileManager does not conform to Equatable on non-apple platforms. :) Thank you again for this needed enhancement. 🙏🏻 |
Thanks for approving workflows. Switched to NonDecodableObject instead of FileManager. |
@nekrich, please forgive me for the long silence. I've had a very busy season. @jpsim has kindly address the windows failures on older versions of Swift with some administrative wisdom. I believe if you merge/rebase your changes from/with the main branch we can git this improvement merged and released! |
I'll address the macOS 15 with Xcode 16.0 failure today. |
Only one lint issue left to tic then we'll merge and release. 😀 |
Break up long line for SwiftLint rule.
Remove trailing whitespace for SwiftLint.
Feature: Support for
DecodableWithConfiguration
Summary
This PR introduces support for decoding types conforming to the new
DecodableWithConfiguration
protocol.This enables more flexible and context-aware decoding by allowing strongly typed configuration to be passed during decoding — unlike
userInfo
.What's Changed
DecodableWithConfiguration
objects._Decoder
construction and Node parsing logic across calls to decodeDecodable
andDecodableWithConfiguration
.JSONDecoder
.Why
Some types require external context (e.g., formatting rules, environment settings, or feature flags) when being decoded.
DecodableWithConfiguration
enables passing that context directly into the decoding process without affecting other parts of the codebase.Tests
Provided for both cases:
DecodingConfiguration
instance.DecodingConfigurationProvider
constructor.Breaking changes
None. This change is purely additive and introduces no breaking changes to the existing API.