Questions about additional coding strategies
Hi, I really appreciate this package—it’s been very useful!
I was wondering if you have any plans to support additional coding/decoding strategies similar to those provided by JSONEncoder and JSONDecoder, such as JSONDecoder.DateDecodingStrategy and JSONDecoder.KeyDecodingStrategy?
I would love to hear your plans on this since I am thinking about extending some of this functionality for use in my own code, or maybe contributing back to this repo if I get some of it done.
Thanks!
Hi @chazeon, I think this is a great idea and happy to add this support.
I have recently updated NilCodingStrategy and IntDecodingStrategy to be Sendable so I would just expect these new strategies to also be Sendable.
So would something like this work?
enum KeyDecodingStrategy: Sendable {
...
case custom(@Sendable ([any CodingKey]) -> any CodingKey)
}
Would be good with snake case converted
snake_case is now supported on main branch https://github.com/swhitty/KeyValueCoder/pull/12
Update: available in 0.8.0 release
DateEncoding/DecodingStrategy is now supported on main branch https://github.com/swhitty/KeyValueCoder/pull/14
Update: Available in the 0.9.0 release
Thank you!