Skip to content

A Collection of PropertyWrappers to make custom Serialization of Swift Codable Types easy

License

Notifications You must be signed in to change notification settings

GottaGetSwifty/CodableWrappers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

GottaGetSwiftyPJ Fechner
and
PJ Fechner
Jan 8, 2025
79d9274 · Jan 8, 2025
Jan 7, 2025
Jan 8, 2025
Jan 8, 2025
Oct 21, 2019
Oct 14, 2019
Sep 13, 2023
Sep 13, 2023
Dec 30, 2020
Feb 9, 2022
Jan 7, 2025
Feb 27, 2024
Sep 18, 2019
Jan 8, 2025
Jan 7, 2025
Jan 7, 2025
Jan 7, 2025
Dec 29, 2020

Repository files navigation

CodableWrappers

API Docs codecov

Simplified Serialization with Property Wrappers

Make Complex Codable Serialization a breeze with declarative annotations!

@CustomCodable @SnakeCase
struct User: Codable {
    let firstName: String
    let lastName: String
    @SecondsSince1970DateCoding
    var joinDate: Date
    @CustomCodingKey("data")
    var imageData: Data
}

3.0 released! Release Notes


Documentation

Full DocC documentation here thanks to the Swift Package Index!

Installation

Swift Package Manager *Preferred*

URL:

https://github.com/GottaGetSwifty/CodableWrappers.git

Manifest:

dependencies: [
    .package(url: "https://github.com/GottaGetSwifty/CodableWrappers.git", .upToNextMajor(from: "3.0.0" )),
]

CocoaPods

*WARNING* CocoaPods is not currently supported for version 3.0 to avoid complications with Swift Macros.

pod 'CodableWrappers', '~> 2.0.0'

Available CodingKey Macros

Available Property Wrappers

Additional Customization

Additional Links


Compatibility

  • 3.x supports Swift 5.9+
  • 2.x supports Swift 5.2+
  • 1.x supports Swift 5.1+

Contributions

If there is a standard Serialization or Coding Key strategy that could be added feel free to open an issue requesting it and/or submit a pull request with the new option.