CodableWrappers
CodableWrappers copied to clipboard
Feature request: change name of key
I would like to have a property wrapper that made it possible to change name of the key used when encoding and decoding. The result could look like this:
struct MyStruct: Codable {
@CustomKey("key_in_json") var myOwnName: String
}
It is possible that I can do this by creating a custom codable wrapper, but so far I have not been able to achieve it. The backed codable package has support for this. I think it would be really nice if this package could include this as well :)
This is now possible (in beta) with Macros! here's the tag with the initial release: https://github.com/GottaGetSwifty/CodableWrappers/releases/tag/3.0.0-alpha-release-1
3.0 is now released! https://github.com/GottaGetSwifty/CodableWrappers/releases/tag/3.0.0
Thank you for your patience