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. -
AlamofireObjectMapper
An Alamofire extension which converts JSON response data into swift objects using ObjectMapper -
FlatBuffersSwift
This project brings FlatBuffers (an efficient cross platform serialization library) to Swift.
InfluxDB high-performance time series database

* 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.