Jay alternatives and similar libraries
Based on the "JSON" category.
Alternatively, view Jay alternatives based on common mentions on social networks and blogs.
-
JSONModel
Magical Data Modeling Framework for JSON - allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS and tvOS apps. -
JSONExport
JSONExport is a desktop application for Mac OS X which enables you to export JSON objects as model classes with their associated constructors, utility methods, setters and getters in your favorite language. -
Gloss
DISCONTINUED. [Deprecated] A shiny JSON parsing library in Swift :sparkles: Loved by many from 2015-2021 -
Genome
A simple, type safe, failure driven mapping library for serializing JSON to models in Swift 3.0 (Supports Linux) -
CodableAlamofire
DISCONTINUED. An extension for Alamofire that converts JSON data into Decodable objects. -
Elevate
Elevate is a JSON parsing framework that leverages Swift to make parsing simple, reliable and composable. -
OCMapper
Objective-C library to easily map NSDictionary to model objects, works perfectly with Alamofire. ObjectMapper works similar to GSON -
AlamofireJsonToObjects
An Alamofire extension which converts JSON response data into swift objects using EVReflection
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Jay or a related project?
Popular Comparisons
README
Jay
Pure-Swift JSON parser & formatter. Fully streamable input and output. Linux & OS X ready. Replacement for NSJSONSerialization.
Jay conforms to the following specifications:
- JSON RFC4627
- Open Swift C7 JSON with the use of Jay-C7
For extra convenience functions when working with the JSON enum, check out Jay-Extras.
:question: Why?
We all use JSON. Especially when writing server-side Swift that needs to run on Linux. #0dependencies
This is my take on how a JSON parser should work. This is not another JSON mapping utility library. This is an actual JSON parser and formatter. Check out the code, it was fun to write ๐
Features
- [x] Parsing: data -> JSON object
- [x] Formatting: JSON object -> data
- [x] Pretty printing
- [x] Streaming input and output, low memory footprint
Usage
Parsing from data (deserialization)
do {
//get data from disk/network
let data: [UInt8] = ...
//ask Jay to parse your data
let json = try Jay().jsonFromData(data) // JSON
//or
let json = try Jay().anyJsonFromData(data) // [String: Any] or [Any]
//if it doesn't throw an error, all went well
if let tasks = json.dictionary?["today"]?.array {
//you have a dictionary root object, with an array under the key "today"
print(tasks) //["laundry", "cook dinner for gf"]
}
} catch {
print("Parsing error: \(error)")
}
Formatting into data (serialization)
do {
//get a json object (works for both [String: Any] and typesafe versions - JSON)
//ask Jay to generate data
let anyContainer = ... // [String: Any] or [Any]
let data = try Jay(formatting: .prettified).dataFromJson(any: json) // [UInt8]
//or
let json: JSON = ... // JSON
let data = try Jay(formatting: .prettified).dataFromJson(json: json) // [UInt8]
//send data over network, save to disk
} catch {
print("Formatting error: \(error)")
}
Installation
Swift Package Manager
.Package(url: "https://github.com/czechboy0/Jay.git", majorVersion: 1)
:blue_heart: Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
:gift_heart: Contributing
Please create an issue with a description of your problem or open a pull request with a fix.
:v: License
MIT
:alien: Author
Honza Dvorsky - http://honzadvorsky.com, @czechboy0
*Note that all licence references and agreements mentioned in the Jay README section above
are relevant to that project's source code only.