NativeJSONMapper alternatives and similar libraries
Based on the "JSON" category.
Alternatively, view NativeJSONMapper alternatives based on common mentions on social networks and blogs.
-
MJExtension
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. -
SBJson
This framework implements a strict JSON parser and generator in Objective-C. -
HandyJSON
A handy swift json-object serialization/deserialization library -
AlamofireObjectMapper
An Alamofire extension which converts JSON response data into swift objects using ObjectMapper -
json-swift
A basic library for working with JSON in Swift. -
FlatBuffersSwift
This project brings FlatBuffers (an efficient cross platform serialization library) to Swift. -
Motis
Easy JSON to NSObject mapping using Cocoa's key value coding (KVC) -
Serpent
A protocol to serialize Swift structs and classes for encoding and decoding. -
JAYSON
🧱 A JSON decoding/encoding library that handles optimistically or strictly. -
MagicMapper
🌟 Super light and easy automatic JSON to model mapper -
Mappable
flexible JSON to Model converter, specially optimized for immutable properties -
WAMapping
A library to turn dictionary into object and vice versa for iOS. Designed for speed! -
NSTEasyJSON
The better way to deal with JSON in Objective-C (inspired by SwiftyJSON) -
GuardedSwiftyJSON
Swift guarded model initializers for SwiftyJSON -
Alter
Alter is framework to make mapping Codable property and key easier. -
jsoncafe.com
Online Template driven Model Class Generator from JSON.
Appwrite - The open-source backend cloud platform
* 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 NativeJSONMapper or a related project?
README
NativeJSONMapper
Simple Swift 4 encoding & decoding for Codable
protocol objects.
Installation
pod 'NativeJSONMapper'
Usage
Decoding:
Simple Coding
object:
struct CodableModel: Codable {
var foo: String
var bar: Int
enum CodingKeys: String, CodingKey {
case foo = "foo_key"
case bar = "bar_key"
}
}
Mapping:
// json string
let jsonString: Any = "{\"foo_key\" : \"FooBar\", \"bar_key\" : 1}"
// json dictionary
let jsonDictionary: [String : Any] = ["foo_key" : "FooBar",
"bar_key" : 1]
// json dictionaries array
let jsonDictionariesArray: [[String : Any]] = (0...10).map { ["foo_key" : "FooBar - \($0)",
"bar_key" : $0] }
//Mapping
let mapper = NativeJSONMapper()
do {
// string
let fromString = try mapper.map(jsonString, to: CodableModel.self)
// dictionary
let fromDictionary = try mapper.map(jsonDictionary, to: CodableModel.self)
// dictionaries array
let fromDictionariesArray = try mapper.map(jsonDictionariesArray, to: [CodableModel].self)
} catch {
// handle error
}
Encoding:
let model = CodableModel(foo: "FooBar", bar: 1)
let mapper = NativeJSONMapper()
do {
let data = try mapper.encode(model)
let string = try mapper.encodeToString(model)
let dictionary = try mapper.encodeToDictionary(model)
} catch {
// handle error
}
Custom decoder:
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .secondsSince1970
let mapper = NativeJSONMapper(decoder: decoder)
//...
License
NativeJSONMapper is under MIT license. See the [LICENSE](LICENSE) file for more info.
*Note that all licence references and agreements mentioned in the NativeJSONMapper README section above
are relevant to that project's source code only.