A Swift library that makes it easy to handle JSON data with type safety and concise syntax.
SwiftyJSON is a Swift library that simplifies working with JSON data by providing a concise, type-safe API. It eliminates the need for verbose optional chaining and manual type casting when parsing JSON responses from APIs or local files. The library makes JSON handling more readable and less error-prone in Swift applications.
Swift developers building iOS, macOS, tvOS, or watchOS apps that consume JSON APIs. It's particularly useful for mobile and desktop developers who need to parse network responses or configuration files efficiently.
Developers choose SwiftyJSON because it dramatically reduces boilerplate code compared to native Swift JSON handling, offers built-in error safety, and integrates smoothly with popular networking stacks like Alamofire and Moya. Its intuitive subscript syntax and chainable accessors make JSON manipulation feel natural in Swift.
The better way to deal with JSON data in Swift.
Eliminates verbose optional chaining and manual type casting, as shown in the README where accessing nested values like json[0]["user"]["name"].string replaces multiple lines of native Swift code.
Provides both optional (e.g., .string) and non-optional getters (e.g., .stringValue) that handle type conversion safely, reducing runtime errors without explicit casts.
Includes detailed errors for out-of-bounds indices, missing keys, and type mismatches (e.g., json[999].error prints "Array[999] is out of bounds"), preventing crashes and aiding debugging.
Works directly with Alamofire and Moya to parse response data into SwiftyJSON objects, simplifying JSON handling in common networking workflows.
Unlike Swift's Codable, SwiftyJSON requires manual parsing for each field, adding boilerplate when mapping JSON to structured Swift models, which can be tedious for large APIs.
The abstraction layer introduces slight overhead compared to direct JSONSerialization use, which might matter in performance-sensitive apps parsing large or frequent JSON payloads.
The chainable, subscript-based API is more imperative and less declarative than alternatives like functional parsing libraries, which may not align with all codebase philosophies.
JSON for Modern C++
FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
A Java serialization/deserialization library to convert Java Objects into JSON and back
Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.