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.

Related tags

JSON jsonmodel
Overview

JSONModel - Magical Data Modeling Framework for JSON

JSONModel allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS and tvOS apps. Automatic introspection of your model classes and JSON input drastically reduces the amount of code you have to write.

See CHANGELOG.md for details on changes.

Installation

CocoaPods

pod 'JSONModel'

Carthage

github "jsonmodel/jsonmodel"

Manual

  1. download the JSONModel repository
  2. copy the JSONModel sub-folder into your Xcode project
  3. link your app to SystemConfiguration.framework

Basic Usage

Consider you have JSON like this:

{ "id": 10, "country": "Germany", "dialCode": 49, "isInEurope": true }
  • create a JSONModel subclass for your data model
  • declare properties in your header file with the name of the JSON keys:
@interface CountryModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString *country;
@property (nonatomic) NSString *dialCode;
@property (nonatomic) BOOL isInEurope;
@end

There's no need to do anything in the implementation (.m) file.

  • initialize your model with data:
NSError *error;
CountryModel *country = [[CountryModel alloc] initWithString:myJson error:&error];

If the validation of the JSON passes. you have all the corresponding properties in your model populated from the JSON. JSONModel will also try to convert as much data to the types you expect. In the example above it will:

  • convert id from string (in the JSON) to an int for your class
  • copy the country value
  • convert dialCode from a number (in the JSON) to an NSString value
  • copy the isInEurope value

All you have to do is define the properties and their expected types.

Examples

Automatic name based mapping

{
	"id": 123,
	"name": "Product name",
	"price": 12.95
}
@interface ProductModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString *name;
@property (nonatomic) float price;
@end

Model cascading (models including other models)

{
	"orderId": 104,
	"totalPrice": 13.45,
	"product": {
		"id": 123,
		"name": "Product name",
		"price": 12.95
	}
}
@interface ProductModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString *name;
@property (nonatomic) float price;
@end

@interface OrderModel : JSONModel
@property (nonatomic) NSInteger orderId;
@property (nonatomic) float totalPrice;
@property (nonatomic) ProductModel *product;
@end

Model collections

{
	"orderId": 104,
	"totalPrice": 103.45,
	"products": [
		{
			"id": 123,
			"name": "Product #1",
			"price": 12.95
		},
		{
			"id": 137,
			"name": "Product #2",
			"price": 82.95
		}
	]
}
@protocol ProductModel;

@interface ProductModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString *name;
@property (nonatomic) float price;
@end

@interface OrderModel : JSONModel
@property (nonatomic) NSInteger orderId;
@property (nonatomic) float totalPrice;
@property (nonatomic) NSArray <ProductModel> *products;
@end

Note: the angle brackets after NSArray contain a protocol. This is not the same as the Objective-C generics system. They are not mutually exclusive, but for JSONModel to work, the protocol must be in place.

Also property can have generics info for compiler

@interface OrderModel : JSONModel
@property (nonatomic) NSInteger orderId;
@property (nonatomic) float totalPrice;
@property (nonatomic) NSArray<ProductModel *> <ProductModel> *products;
@end

Nested key mapping

{
	"orderId": 104,
	"orderDetails": {
		"name": "Product #1",
		"price": {
			"usd": 12.95
		}
	}
}
@interface OrderModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString *productName;
@property (nonatomic) float price;
@end

@implementation OrderModel

+ (JSONKeyMapper *)keyMapper
{
	return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{
		@"id": @"orderId",
		@"productName": @"orderDetails.name",
		@"price": @"orderDetails.price.usd"
	}];
}

@end

Map automatically to snake_case

{
	"order_id": 104,
	"order_product": "Product #1",
	"order_price": 12.95
}
@interface OrderModel : JSONModel
@property (nonatomic) NSInteger orderId;
@property (nonatomic) NSString *orderProduct;
@property (nonatomic) float orderPrice;
@end

@implementation OrderModel

+ (JSONKeyMapper *)keyMapper
{
	return [JSONKeyMapper mapperForSnakeCase];
}

@end

Optional properties (i.e. can be missing or null)

{
	"id": 123,
	"name": null,
	"price": 12.95
}
@interface ProductModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString <Optional> *name;
@property (nonatomic) float price;
@property (nonatomic) NSNumber <Optional> *uuid;
@end

Ignored properties (i.e. JSONModel completely ignores them)

{
	"id": 123,
	"name": null
}
@interface ProductModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString <Ignore> *customProperty;
@end

Making scalar types optional

{
	"id": null
}
@interface ProductModel : JSONModel
@property (nonatomic) NSInteger id;
@end

@implementation ProductModel

+ (BOOL)propertyIsOptional:(NSString *)propertyName
{
	if ([propertyName isEqualToString:@"id"])
		return YES;

	return NO;
}

@end

Export model to NSDictionary or JSON

ProductModel *pm = [ProductModel new];
pm.name = @"Some Name";

// convert to dictionary
NSDictionary *dict = [pm toDictionary];

// convert to json
NSString *string = [pm toJSONString];

Custom data transformers

@interface JSONValueTransformer (CustomTransformer)
@end

@implementation JSONValueTransformer (CustomTransformer)

- (NSDate *)NSDateFromNSString:(NSString *)string
{
	NSDateFormatter *formatter = [NSDateFormatter new];
	formatter.dateFormat = APIDateFormat;
	return [formatter dateFromString:string];
}

- (NSString *)JSONObjectFromNSDate:(NSDate *)date
{
	NSDateFormatter *formatter = [NSDateFormatter new];
	formatter.dateFormat = APIDateFormat;
	return [formatter stringFromDate:date];
}

@end

Custom getters/setters

@interface ProductModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString *name;
@property (nonatomic) float price;
@property (nonatomic) NSLocale *locale;
@end

@implementation ProductModel

- (void)setLocaleWithNSString:(NSString *)string
{
	self.locale = [NSLocale localeWithLocaleIdentifier:string];
}

- (void)setLocaleWithNSDictionary:(NSDictionary *)dictionary
{
	self.locale = [NSLocale localeWithLocaleIdentifier:dictionary[@"identifier"]];
}

- (NSString *)JSONObjectForLocale
{
	return self.locale.localeIdentifier;
}

@end

Custom JSON validation

@interface ProductModel : JSONModel
@property (nonatomic) NSInteger id;
@property (nonatomic) NSString *name;
@property (nonatomic) float price;
@property (nonatomic) NSLocale *locale;
@property (nonatomic) NSNumber <Ignore> *minNameLength;
@end

@implementation ProductModel

- (BOOL)validate:(NSError **)error
{
	if (![super validate:error])
		return NO;

	if (self.name.length < self.minNameLength.integerValue)
	{
		*error = [NSError errorWithDomain:@"me.mycompany.com" code:1 userInfo:nil];
		return NO;
	}

	return YES;
}

@end

License

MIT licensed - see LICENSE file.

Contributing

We love pull requests! See CONTRIBUTING.md for full details.

Issues
  • Crashes in JSONModel.m line 855 (reason unknown)

    Crashes in JSONModel.m line 855 (reason unknown)

    Since using JSONModel 1.2.0 our app is regularly reporting crashes in JSONModel dictionary deserialization. To be specific, the crashes happen in __customSetValue:forProperty:.

    Sadly, I cannot provide any data that reproduces the error, but maybe the author can find any possible problem in this code.

    Here is the respective call stack of one such crash:

    Thread : Crashed: com.apple.root.default-qos
    0  libobjc.A.dylib                0x3958df62 objc_msgSend + 1
    1  CoreFoundation                 0x2b00a17d -[__NSDictionaryM setObject:forKey:] + 340
    2  App                            0x2a316b __arclite_NSMutableDictionary__setObject_forKeyedSubscript(NSMutableDictionary*, objc_selector*, objc_object*, objc_object*) (arclite.mm:1669)
    3  App                            0x1d2bed -[JSONModel __customSetValue:forProperty:] (JSONModel.m:855)
    4  App                            0x1d0b7b -[JSONModel __importDictionary:withKeyMapper:validation:error:] (JSONModel.m:342)
    5  App                            0x1cfbd9 -[JSONModel initWithDictionary:error:] (JSONModel.m:191)
    6  App                            0x1d3a15 +[JSONModel arrayOfModelsFromDictionaries:error:] (JSONModel.m:1124)
    7  App                            0x1bb4dd __68-[AppService service:success:failure:]_block_invoke_2 (AppService.m:21)
    8  libdispatch.dylib              0x39b11c83 _dispatch_call_block_and_release + 10
    9  libdispatch.dylib              0x39b1e86b _dispatch_root_queue_drain + 1374
    10 libdispatch.dylib              0x39b1f8a3 _dispatch_worker_thread3 + 106
    11 libsystem_pthread.dylib        0x39c93d9d _pthread_wqthread + 668
    12 libsystem_pthread.dylib        0x39c93af0 start_wqthread + 8
    
    opened by wberger 31
  • Added millisecond support for NSDate objects

    Added millisecond support for NSDate objects

    JSONModel was failing to parse NSDate values with milliseconds, for example "2013-11-27T05:00:00.000Z". I created a fork of JSONModel and made a fix, including an additional unit test case. Could you please review it and pull it into the main project if it looks good?

    Thanks, Scott

    opened by scottadav 24
  • BOOL properties serialize to integers

    BOOL properties serialize to integers

    Hi. Because KVC converts BOOL properties to __NSCFNumber rather than __NSCFBoolean (when using valueForKey:, for example), setting a BOOL property with initWithDictionary results in it being rendered as 0 or 1 rather than 'true' or 'false' when I subsequently serialize my model class to JSON.

    Do you have any suggestions for how to work around this problem? I can't believe I'm the first person to use JSON booleans but I couldn't find any other issue related to this use case.

    Thanks for your help, and for writing JSONModel, which is otherwise great!

    opened by ablock 22
  • Allow collection model subclasses to be defined without using protocols

    Allow collection model subclasses to be defined without using protocols

    An error is thrown after trying to deserialize a typed array in Swift. The type of the array also inherits from JSONModel but the deserialization does not dive into the dictionaries inside the array. So instead of giving an array with objects of JSONModelSubClass it gives an array of NSDictionary objects.

    The error: "fatal error: NSArray element failed to match the Swift Array Element type"

    So, I fixed that by giving an option to supply a dictionary with array names and their types. Like JSONKeyMapper is initialized with custom mapping dictionary, I gave the option to implement a method for declaring arrays and types mapping.

    I'll upload my fix to this issue's branch and you guys can review it.

    Thanks!

    opened by PerrchicK 18
  • JSONModel copy

    JSONModel copy

    I have a subclass of JSONModel.

    Let's call the subclass MyModel.

    MyModel *a = ....

    [a copy] performs only a shallow copy. Is this intended behaviour? How can I get it to do a deep copy so the NSDate * fields's values get copied over.

    opened by pjebs 17
  • Status Codes

    Status Codes

    Is there a way to handle different status codes back from an API. For instance, if the server returns a 401 for an expired/reset authentication token, or a 500 or server outage there is no way to tell the difference. Would it be possible to simply pass the error code up along with the JSONModelError?

    opened by azuby 16
  • about dictionary value is array

    about dictionary value is array

    @billinghamj i need help, thanks

    
    {
        "response": {
            "49": {
                "count": 6,
                "list": {
                    "16:50-17:50": [
                        {
                            "first_address": "B",
                            "order_id": "458260",
                            "order_num": 10,
                            "time": "16:50-17:50",
                            "user_id": "71851"
                        },
                        {
                            "first_address": "B",
                            "order_id": "458261",
                            "order_num": 11,
                            "time": "16:50-17:50",
                            "user_id": "71851"
                        },
                        {
                            "first_address": "B",
                            "order_id": "458262",
                            "order_num": 12,
                            "time": "16:50-17:50",
                            "user_id": "71851"
                        }
                    ],
                    "18:10-19:00": [
                        {
                            "first_address": "B",
                            "order_id": "458263",
                            "order_num": 13,
                            "time": "18:10-19:00",
                            "user_id": "71851"
                        },
                        {
                            "first_address": "B",
                            "order_id": "458264",
                            "order_num": 14,
                            "time": "18:10-19:00",
                            "user_id": "71851"
                        },
                        {
                            "first_address": "B",
                            "order_id": "458265",
                            "order_num": 15,
                            "time": "18:10-19:00",
                            "user_id": "71851"
                        }
                    ]
                },
                "name": "food"
            }
        },
        "responseTime": "1453710085",
        "result": "true",
        "resultElapse": 6,
        "resultMessage": "success",
        "resultNum": "200"
    }
    
    
    
    @interface Response : JSONModel
    @property (assign, nonatomic)BOOL result;
    @property (assign, nonatomic)NSInteger resultNum;
    @property (assign, nonatomic)NSInteger responseTime;
    @property (strong, nonatomic)NSString *resultMessage;
    @property (strong, nonatomic)NSDictionary <GroupOrder> *response;
    @end
    
    
    @protocol GroupOrder
    @end
    @interface GroupOrder : JSONModel
    @property (strong, nonatomic) NSDictionary<NSString*, NSArray<Order>*> *list;
    @property (strong, nonatomic) NSString *name;
    @property (nonatomic) int count;
    
    @end
    
    @protocol Order
    @end
    
    @interface Order : JSONModel
    @property (strong, nonatomic) NSString *first_address;
    @property (nonatomic) int order_id;
    @property (nonatomic) int order_num;
    @property (strong, nonatomic) NSString *time;
    @property (nonatomic) int *user_id;
    
    @end
    

    how should I declare GroupOrder property list?

    opened by a0000 16
  • Core Data

    Core Data

    Hello,

    Is there some way to use JSONModel do create Core Data objects? The only way I can think is to let JSONModel handle all the JSON work and then copy all the fields to a custom NSManagedObject if the conversion was successful… or is there another way to create the NSManagedObject that I'm not aware of?

    Thanks!

    opened by carlosefonseca 16
  • New Objective C syntax (lightweight generics)

    New Objective C syntax (lightweight generics)

    In the new version of Objective C (on XCode 7), we can now specify what a NSArray can contain.

    Will your library support this? It will definitely reduce the amount of casting we need to do.

    Say we have a JSONModel subclass called Cars.

    Say we have another JSONModel subclass called Person:

    @property (strong, nonatomic) NSArray < Cars * > * cars; //Restricting NSArray to Cars

    rather than currently:

    @protocol Cars @end

    @property (strong, nonatomic) NSArray < Cars > * cars; //Currently

    opened by pjebs 16
  • Fix custom setter dictionary crash when multithreading(#436)

    Fix custom setter dictionary crash when multithreading(#436)

    Fix crash by moving custom setter name generation to __inspectProperties__ method. @billinghamj Do you have unit test cases I can run with? to check the fix won't break other parts.

    opened by robinzhangx 15
  •  optimiza the process of key mapping

    optimiza the process of key mapping

    null

    opened by uncleflower 0
  • Xcode 13 Duplicate JSONKeyMapper

    Xcode 13 Duplicate JSONKeyMapper

    Xcode 13 Duplicate interface definition for class 'JSONKeyMapper'

    opened by LiynXu 0
  • Update JSONModel.m

    Update JSONModel.m

    change @"Optional" to NSStringFromProtocol(@protocol(Optional)

    opened by wangyingbo 0
  • Added Swift package manager support to JSONModel

    Added Swift package manager support to JSONModel

    Would it be possible to get this in and a new release from the master after that?

    I know that this repo is bit stale, but this is still used in some projects and it would be nice that we could point to release and the original code base.

    opened by MapaX 1
  • UIColor ?

    UIColor ?

    If i try to use UIColor property i get: [JSONValueTransformer __JSONObjectFromUIColor:] not found

    In the debug i see "value" is "UIExtendedSRGBColorSpace 0 1 0 1"

    Should i write some additional text to support UIColor ?

    opened by SmartHbdev 0
  • how to user ismutable?

    how to user ismutable?

    how to user ismutable?

    opened by yuquanZhu 0
  • I don't understand the scence where is 'Optional',’Index‘ and 'Ignore' below?

    I don't understand the scence where is 'Optional',’Index‘ and 'Ignore' below?

    The method below:

    • (void)__inspectProperties It deal protocols with the key 'Optional'、'Index'、’Ignore‘ image

    Where is the scence? @billinghamj

    opened by stackJolin 0
  • How to convert JSONModel class properties to snake_case NSDictionary?

    How to convert JSONModel class properties to snake_case NSDictionary?

    Hello, I am new to this library and after searching through the issues and through the code I did not find any solution to this question. I am using [JSONKeyMapper mapperForSnakeCase] to map dictionary keys to the class properties and was wondering if there is a method where I can convert the class properties back to snake_case dictionary to send the data with the same keys the server sent initially before mapping in snake_case. Thank you!

    opened by CochiorasBogdan 0
  • Is there a way to rename individual keys in JSON?

    Is there a way to rename individual keys in JSON?

    Weird situation here. I'm using the snake case mapping already, and need to rename one particular field. We want the code we write to be easy to read and consistent, but the API has a legacy spelling error that we need to support:

    @interface Object : JSONModel
    
    // property_one in JSON
    @property (nonatomic) NSString *propertyOne;
    // property_two in JSON
    @property (nonatomic) NSString *propertyTwo;
    // SPELLING ERROR: porperty_three in JSON
    @property (nonatomic) NSString *propertyThree;
    
    @end
    
    @implementation
    
    + (JSONKeyMapper *)keyMapper
    {
        return [JSONKeyMapper mapperForSnakeCase];
    }
    
    @end
    

    I've added three methods to the implementation, but don't know a way to get JSONModel to call them:

    - (void)setPorpertyThreeWithNSString:(NSString *)string
    {
        _propertyThree = string;
    }
    
    - (void)JSONObjectForPropertyThree
    {
        // We don't want to return "property_three", we want to return "porperty_three"
        return nil;
    }
    
    - (void)JSONObjectForPorpertyThree
    {
        return _propertyThree;
    }
    

    The second method is called when I convert my object to JSON (removing the property_three key), but the first and last methods aren't called. I'm looking for something like:

    - (NSArray<NSString*> *) extraProperties
    {
        return @[@"porperty_three"];
    }
    
    opened by stevendesu 2
  • Bubbling errors when a child model fails to validate?

    Bubbling errors when a child model fails to validate?

    Given a model defined like so:

    @interface Parent : JSONModel
    
    @property Child child;
    
    @end
    
    @interface Child : JSONModel
    
    @property NSString *requiredField;
    @property (nullable) NSString <Optional> *optionalField;
    
    @end
    

    if you try to instantiate the following:

    NSString *json = @"{ \"child\": { \"optionalField\": \"asdf\" } }";
    NSError *error;
    Parent *test = [Parent initWithString:json];
    

    The console will log out a validation error (namely that the field requiredField was missing from Child) but you'll find that test is actually set, but test.child is nil, and error is nil.

    This means that only the top level is actually being validated by the error we pass in, and I can't use it to tell if a child model had a validation problem.

    It seems to me like the default behavior should be if any model fails to validate, error is set.

    opened by stevendesu 0
Releases(1.7.0)
  • 1.7.0(Oct 7, 2016)

  • 1.6.0(Oct 5, 2016)

  • 1.5.1(Sep 12, 2016)

  • 1.5.0(Sep 12, 2016)

    • deprecated mapperFromUpperCaseToLowerCase (not replaced - it didn't really make sense)
    • renamed mapperFromUnderscoreCaseToCamelCase to mapperForSnakeCase for clarity
    Source code(tar.gz)
    Source code(zip)
  • 1.4.2(Sep 12, 2016)

  • 1.4.1(Sep 12, 2016)

  • 1.4.0(Sep 12, 2016)

  • 1.2.0(Jul 22, 2016)

    • support added for watchOS and tvOS
    • minimum iOS version bumped to 6.0
    • support added for Carthage
    • deprecated +arrayOfModelsFromDictionaries: in favor of +arrayOfModelsFromDictionaries:error:
    • added +arrayOfModelsFromString:error:
    • deprecated +mergeFromDictionary: in favor of mergeFromDictionary:useKeyMapping:error:
    • added support for multiple custom setters
    • fixed -hash implementation
    • added responseData property to JSONModelError
    • added support for creating a key mapper with exceptions (+mapper:withExceptions:)
    • locks now used in key mapper implementation for additional safety
    • fixed behavior of NSURLFromNSString transformer
    • updated project files to latest Xcode
    • updated demo apps to work with the latest JSONModel & external API code
    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Jul 22, 2016)

    Sorry for the long time since the last release. We'll be trying to maintain a more rapid release schedule going forwards.

    • precision issue fixed with deserializing numbers
    • support added for deserializing into a 'root' dictionary (dictionaryOfModelsFromDictionary:error:, etc.)
    • lazy collection-type conversion (ConvertOnDemand) is no longer supported
    • deprecated two way key mapping deprecated - only Model->JSON has ever worked anyway
    • deprecated all networking support
    • deprecated the global key mapper
    • deprecated Index protocol
    • deprecated protocolForArrayProperty: in favor of classForCollectionProperty:
    • modulemap file added to handle use as a framework better
    • success return value added to mergeFromDictionary:useKeyMapping:error:
    • JSONModel has now been moved out into its own GitHub organization, etc. - now maintained by multiple people

    Potential Breaking Changes

    • new behavior for handling null values when serializing:
      • values of NSNull will now always null in JSON output
      • values of nil will now never be included in JSON output
    Source code(tar.gz)
    Source code(zip)
Owner
JSONModel
JSONModel
macOS app to generate Swift 5 code for models from JSON (with Codeable)

SwiftyJSONAccelerator - MacOS app Codeable Model file Generator For Swift 5 Version v2.2 Generate initializer function for classes Application Downloa

Karthikeya Udupa 906 Nov 25, 2021
Coolie(苦力) helps you to create models (& their constructors) from a JSON file.

Coolie(苦力) Coolie parse a JSON file to generate models (& their constructors). 苦力有很强的类型推断能力,除了能识别 URL 或常见 Date 类型,还能自动推断数组类型(并进行类型合并),你可从下面的例子看出细节。 Wo

null 510 Nov 16, 2021
✌ Convert anything into anything in one operation; JSON data into class instances, hex strings into UIColor/NSColor, y/n strings to booleans, arrays and dictionaries of these; anything you can make sense of!

JSONHelper Convert anything into anything in one operation; hex strings into UIColor/NSColor, JSON strings into class instances, y/n strings to boolea

Baris Sencan 792 Jun 3, 2021
A simple, type safe, failure driven mapping library for serializing JSON to models in Swift 3.0 (Supports Linux)

Welcome to Genome 3.0. This library seeks to satisfy the following goals: Data Type Agnostic Failure Driven Nested Mapping Collection Mapping Simple a

logan 778 Nov 21, 2021
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.

MJExtension A fast, convenient and nonintrusive conversion framework between JSON and model. 转换速度快、使用简单方便的字典转模型框架 ?? ✍??Release Notes: more details ‼️

M了个J 8.5k Nov 30, 2021
Auto reflection tool from JSON to Model, user friendly JSON encoder / decoder, aims to never die

JSONNeverDie is an auto reflection tool from JSON to Model, a user friendly JSON encoder / decoder, aims to never die. Also JSONNeverDie is a very imp

John Lui 466 Nov 8, 2021
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.

JSONExport JSONExport is a desktop application for Mac OS X written in Swift. Using JSONExport you will be able to: Convert any valid JSON object to a

Ahmed Ali 4.6k Nov 30, 2021
[Deprecated] The easy to use Swift JSON decoder

⚠️ DEPRECATED Unbox is deprecated in favor of Swift’s built-in Codable API and the Codextended project. All current users are highly encouraged to mig

John Sundell 2k Nov 26, 2021
The easy to use Swift JSON encoder

Unbox | Wrap Wrap is an easy to use Swift JSON encoder. Don't spend hours writing JSON encoding code - just wrap it instead! Using Wrap is as easy as

John Sundell 731 Nov 9, 2021
From JSON to Core Data and back.

Groot Groot provides a simple way of serializing Core Data object graphs from or into JSON. It uses annotations in the Core Data model to perform the

Guille Gonzalez 533 Oct 25, 2021
The better way to deal with JSON data in Swift.

SwiftyJSON SwiftyJSON makes it easy to deal with JSON data in Swift. Platform Build Status *OS Linux Why is the typical JSON handling in Swift NOT goo

SwiftyJSON 21k Nov 27, 2021
An extension for Alamofire that converts JSON data into Decodable objects.

Swift 4 introduces a new Codable protocol that lets you serialize and deserialize custom data types without writing any special code and without havin

Nikita Ermolenko 749 Nov 22, 2021
An Alamofire extension which converts JSON response data into swift objects using EVReflection

AlamofireJsonToObjects ?? This is now a subspec of EVReflection and the code is maintained there. ?? You can install it as a subspec like this: use_fr

Edwin Vermeer 160 Jun 3, 2021
An Alamofire extension which converts JSON response data into swift objects using ObjectMapper

AlamofireObjectMapper An extension to Alamofire which automatically converts JSON response data into swift objects using ObjectMapper. Usage Given a U

Tristan Himmelman 2.6k Nov 14, 2021
Elevate is a JSON parsing framework that leverages Swift to make parsing simple, reliable and composable.

Elevate Elevate is a JSON parsing framework that leverages Swift to make parsing simple, reliable and composable. Elevate should no longer be used for

Nike Inc. 618 Nov 6, 2021
This framework implements a strict JSON parser and generator in Objective-C.

SBJson 5 Chunk-based JSON parsing and generation in Objective-C. Overview SBJson's number one feature is stream/chunk-based operation. Feed the parser

null 3.8k Nov 21, 2021
Swift/Obj-C HTTP framework with a focus on REST and JSON

PMHTTP PMHTTP is an HTTP framework built around URLSession and designed for Swift while retaining Obj-C compatibility. We think URLSession is great. B

Postmates Inc. 508 Oct 27, 2021
A reusable framework for parsing JSON in Swift.

Why Freddy? Parsing JSON elegantly and safely can be hard, but Freddy is here to help. Freddy is a reusable framework for parsing JSON in Swift. It ha

Big Nerd Ranch 1.1k Oct 3, 2021
A humane JSON Objective-C un-framework. (TouchJSON has been deprecated - see README)

TouchJSON HOWTO Introduction TouchJSON is an Objective-C based parser and generator for JSON encoded data. TouchJSON compiles for Mac OS X and iOS dev

null 809 Oct 28, 2021