https://github.com/paulmelnikow/rkbsonserialization
A RestKit BSON serialization implementation using ObjCMongoDB
https://github.com/paulmelnikow/rkbsonserialization
Last synced: about 1 month ago
JSON representation
A RestKit BSON serialization implementation using ObjCMongoDB
- Host: GitHub
- URL: https://github.com/paulmelnikow/rkbsonserialization
- Owner: paulmelnikow
- License: apache-2.0
- Created: 2013-06-11T02:52:50.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-07-24T21:55:10.000Z (almost 12 years ago)
- Last Synced: 2025-02-13T16:48:41.423Z (3 months ago)
- Language: Objective-C
- Size: 129 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
RKBSONSerialization
===================A RestKit [BSON][] serialization implementation using [ObjCMongoDB][]
The root object in a BSON object must be a dictionary, so if you're sending an array you need to wrap it in a dictionary. If you're pushing an arary, you can use the 'rootKeyPath' property of `RKRequestDescriptor` to automatically wrap the objects into a dictionary.
## Installation
Install via Cocoapods or add the source files to your project. If you are
installing directly from source, you will also need to obtain a copy of the BSON
part of [ObjCMongoDB][].You must register the serialization in your app delegate (or wherever you handle RestKit setup).
You must also register the no-op formatter provided to prevent RestKit from formatting your dates as strings before they reach the serializer. You can either do this globally as shown below, or on individual RKObjectMapping objects.
``` objc
#import "RKBSONSerialization.h"
#import "RKBSONDateFormatter.h"[RKMIMETypeSerialization registerClass:[RKBSONSerialization class] forMIMEType:@"application/bson"];
[RKObjectMapping setPreferredDateFormatter:[[RKBSONDateFormatter alloc] init]];```
## Acknowledgements
Based on [RKJSONKitSerialization][].
[ObjCMongoDB]: https://github.com/paulmelnikow/ObjCMongoDB
[BSON]: http://bsonspec.org/
[RKJSONKitSerialization]: https://github.com/RestKit/RKJSONKitSerialization