You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-69Lines changed: 11 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,14 @@ A library for loading data from a [JSON API](http://jsonapi.org) datasource. Par
9
9
10
10
Version | Changes
11
11
--- | ---
12
+
**1.0.0-rc1** | Rewrote core of `JSONAPI` and `JSONAPIResource` and all unit tests to be up to spec with JSON API spec 1.0.0-rc3. Removed `JSONAPIResourceLinker`. Added `JSONAPIErrorResource`
12
13
**0.2.0** | Added `NSCopying` and `NSCoded` to `JSONAPIResource`; Added `JSONAPIResourceFormatter` to format values before getting mapped - [more info](#formatter)
13
14
**0.1.2** | `JSONAPIResource` IDs can either be numbers or strings (thanks [danylhebreux](https://github.com/danylhebreux)); `JSONAPIResource` subclass can have mappings defined to set JSON values into properties automatically - [more info](#resource-mappings)
14
15
**0.1.1** | Fixed linked resources with links so they actually link to other linked resources
15
16
**0.1.0** | Initial release
16
17
17
18
### Features
18
19
- Parses datasource into manageable objects of `JSONAPIResource`
19
-
- Auto-links resources with custom link mapping definitions using `JSONAPIResourceLinker` (ex: link 'book' to 'books', link 'person' to 'people')
20
20
- Allows resource types to be created into subclasses of `JSONAPIResource` using `JSONAPIResourceModeler`
21
21
- Set mapping for `JSONAPIResource` subclass to set JSON values into properties
22
22
@@ -30,7 +30,7 @@ Clone the repository and drop in the .h and .m files from the "Classes" director
30
30
JSONAPI is available through [CocoaPods](http://cocoapods.org), to install
31
31
it simply add the following line to your Podfile:
32
32
33
-
pod 'JSONAPI', '~> 0.2.0'
33
+
pod 'JSONAPI', '~> 1.0.0-rc1'
34
34
35
35
## Usage
36
36
@@ -54,13 +54,13 @@ Below is an example to register a "Date" function to format a date in a NSString
NSLog(@"\"%@\" by %@", [post objectForKey:@"name"], [author objectForKey:@"name"]);
174
-
}
175
-
176
-
````
177
-
178
-
### Parsing - Using linked resources, subclassed JSONAPIResource classes, and model mappings
125
+
### Parsing - Using subclassed JSONAPIResource classes, and model mappings
179
126
This example shows how a response can be mapped directly into properties of a sublcasses JSONAPIResource
180
127
181
128
```` objc
182
129
183
-
NSString *json = @"{\"posts\":[{\"id\":1,\"name\":\"A post!\",\"links\":{\"author\":9,\"comments\":[2,3]}},{\"id\":2,\"name\":\"Another post!\",\"links\":{\"author\":10,\"comments\":[3,4]}}],\"linked\":{\"people\":[{\"id\":9,\"name\":\"Josh Holtz\"},{\"id\":10,\"name\":\"Bandit the Cat\"}],\"comments\":[{\"id\":2,\"text\":\"Omg this post is awesome\"},{ \"id\":3,\"text\":\"Omg this post is awesomer\"},{ \"id\":4,\"text\":\"Meeeehhhhh\"}]}}";
184
-
185
-
// Links "author" resource to "people" linked resources
0 commit comments