A Swift macro framework that extends Codable with declarative annotations for simpler JSON serialization.
ReerCodable is a Swift framework that enhances the native Codable protocol using Swift macros, providing a declarative annotation system to simplify JSON encoding and decoding. It eliminates boilerplate code by generating Codable implementations automatically, making serialization more intuitive and maintainable for Swift developers.
Swift developers working on iOS, macOS, tvOS, visionOS, or watchOS apps who need to serialize and deserialize complex data models to/from JSON or other formats. It is particularly useful for developers dealing with inconsistent API responses, complex nested structures, or legacy codebases requiring extensive custom serialization logic.
Developers choose ReerCodable over native Codable or other serialization libraries because it dramatically reduces boilerplate with a declarative, annotation-based approach while maintaining full standard library compatibility. Its unique selling point is the extensive feature set powered by Swift macros, including flexible key mapping, advanced type handling, inheritance support, and lifecycle callbacks, which are not available in the standard Codable implementation.
Codable extensions using Swift Macro
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses macros like @CodingKey and @SnakeCase to eliminate manual CodingKeys enums, reducing boilerplate code significantly, as demonstrated in side-by-side comparisons with native Codable in the README.
Supports nested keys via dot notation, multiple decoding keys for fallback parsing, and separate encoding keys, enabling complex JSON structures to be handled with simple annotations.
Built-in support for dates, base64 data, enums with associated values, and automatic type conversion via @FlexibleType, simplifying serialization of diverse and inconsistent API data.
Seamlessly handles subclass serialization with @InheritedCodable and offers full compatibility with NSObject subclasses, addressing a key limitation of native Codable.
Setting up with CocoaPods, especially for Pod components, requires manual configuration of build settings and post-install hooks, which is error-prone and poorly documented compared to SPM.
Only the @Codable macro expands in Xcode; other macros like @SnakeCase do not show responses in the IDE, potentially hindering development and debugging for complex annotations.
Requires Xcode 16.0+, Swift 5.10+, and specific swift-syntax versions, making it incompatible with projects locked to older toolchains or those with slower upgrade cycles.