An Alamofire extension that seamlessly converts JSON responses into Swift Decodable objects.
CodableAlamofire is a Swift library that extends Alamofire to automatically convert JSON API responses into Swift Decodable objects. It leverages Swift's Codable protocol to eliminate manual JSON parsing, making network requests more type-safe and reducing boilerplate code. This library simplifies integrating network calls with Swift's modern serialization features.
Swift developers building iOS, macOS, tvOS, watchOS, or Linux applications who use Alamofire for networking and want to adopt Codable for JSON handling. It's ideal for those seeking to write cleaner, more maintainable network layer code.
Developers choose CodableAlamofire because it seamlessly integrates Alamofire with Swift's Codable protocol, offering a concise and type-safe way to handle JSON responses. Its keyPath support and custom decoder options provide flexibility without sacrificing the simplicity of automatic decoding.
An extension for Alamofire that converts JSON data into Decodable objects.
Provides a `responseDecodableObject` method that automatically decodes JSON into Decodable types, eliminating manual parsing as demonstrated in the README with the Repo struct example.
Allows specifying keyPaths to decode nested JSON objects, making it easy to extract specific data structures like 'result.libraries' without extra mapping code.
Supports custom JSONDecoder configurations, such as date decoding strategies (e.g., .secondsSince1970), enabling flexible parsing tailored to API requirements.
Leverages Swift's Codable protocol for compile-time safety, reducing runtime errors by ensuring response data matches expected types like Repo or [Repo].
Works across iOS, macOS, tvOS, watchOS, and Linux, ensuring broad usability in Swift projects as highlighted in the platform badges.
Ties your project to Alamofire; if you need to switch networking libraries or reduce dependencies, you'll have to rewrite the network layer and lose this convenience.
Focuses solely on JSON decoding, so it's unsuitable for APIs using other data formats like XML or binary, requiring additional workarounds.
For basic networking tasks, the combination of Alamofire and this extension adds unnecessary complexity and bundle size compared to using URLSession directly with Codable.
While powerful, keyPath support can introduce complexity and potential errors when dealing with deeply nested or dynamic JSON structures, as noted in the README's array vs. object handling.
The better way to deal with JSON data in Swift.
Model framework for Cocoa and Cocoa Touch
Simple JSON Object mapping written in Swift
A fast, convenient and nonintrusive conversion framework between JSON and model. Your model class doesn't need to extend any base class. You don't need to modify any model file.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.