Skip to content

Commit c3eebd8

Browse files
committed
* updated the docs with the latest code changes
1 parent 6d44581 commit c3eebd8

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

‎JSONModel/JSONModel/JSONModel.h‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
111111

112112
/**
113113
* Create a new model instance and initialize it with the JSON from a text parameter. The method assumes UTF8 encoded input text.
114-
* @param s JSON text data
114+
* @param string JSON text data
115115
* @param err an initialization error or nil
116116
* @exception JSONModelTypeNotAllowedException thrown when unsported type is found in the incoming JSON,
117117
* or a property type in your model is not supported by JSONValueTransformer and its categories
@@ -121,7 +121,7 @@ lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
121121

122122
/**
123123
* Create a new model instance and initialize it with the JSON from a text parameter using the given encoding.
124-
* @param s JSON text data
124+
* @param string JSON text data
125125
* @param encoding the text encoding to use when parsing the string (see NSStringEncoding)
126126
* @param err an initialization error or nil
127127
* @exception JSONModelTypeNotAllowedException thrown when unsported type is found in the incoming JSON,
@@ -148,7 +148,7 @@ lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
148148
* of model objects. Handy when importing JSON data lists.
149149
* This method will loop over the input list and initialize a data model for every dictionary in the list.
150150
*
151-
* @param a list of dictionaries to be imported as models
151+
* @param array list of dictionaries to be imported as models
152152
* @return list of initialized data model objects
153153
* @exception JSONModelTypeNotAllowedException thrown when unsported type is found in the incoming JSON,
154154
* or a property type in your model is not supported by JSONValueTransformer and its categories
@@ -160,7 +160,7 @@ lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
160160
/**
161161
* If you have an NSArray of data model objects, this method takes it in and outputs a list of the
162162
* matching dictionaries. This method does the opposite of arrayOfObjectsFromDictionaries:
163-
* @param a list of JSONModel objects
163+
* @param array list of JSONModel objects
164164
* @return a list of NSDictionary objects
165165
* @exception JSONModelTypeNotAllowedException thrown when unsported type is found in the incoming JSON,
166166
* or a property type in your model is not supported by JSONValueTransformer and its categories
@@ -180,6 +180,7 @@ lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
180180
/**
181181
* Overriden NSObject method to compare model objects. Compares the <Index> property of the two models,
182182
* if an index property is defined.
183+
* @param object a JSONModel instance to compare to for equality
183184
*/
184185
-(BOOL)isEqual:(id)object;
185186

@@ -188,6 +189,7 @@ lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
188189
* If there isn't an index property throws an exception. If the Index property does not have a compare: method
189190
* also throws an exception. NSString and NSNumber have compare: methods, and in case the Index property is
190191
* a another custom class, the programmer should create a custom compare: method then.
192+
* @param object a JSONModel instance to compare to
191193
*/
192194
-(NSComparisonResult)compare:(id)object;
193195

@@ -201,6 +203,7 @@ lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
201203
*
202204
* NB: Only setting the error parameter is not enough to fail the validation, you also need to return a NO value.
203205
*
206+
* @param error a pointer to an NSError object, to pass back an error if needed
204207
* @return a BOOL result, showing whether the model data validates or not. You can use the convenience method
205208
* [JSONModelError errorModelIsInvalid] to set the NSError param if the data fails your custom validation
206209
*/

‎JSONModel/JSONModel/JSONModelError.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extern NSString* const kJSONModelMissingKeys;
5151

5252
/**
5353
* Creates a JSONModelError instance with code kJSONModelErrorInvalidData = 1
54+
* @param keys a set of field names that were required, but not found in the input
5455
*/
5556
+(id)errorInvalidDataWithMissingKeys:(NSSet*)keys;
5657

‎JSONModel/JSONModelNetworking/JSONAPI.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
/** @name Making GET API requests */
4848
/**
4949
* Makes a synchronious GET request to the API
50+
* @param path the URL path to add to the base API URL for this HTTP call
5051
* @param params the variables to pass to the API
5152
* @param err pointer to an NSError object to pass back an error if needed
5253
* @return the JSON response as desrialized object
@@ -55,6 +56,7 @@
5556

5657
/**
5758
* Makes an asynchronious GET request to the API
59+
* @param path the URL path to add to the base API URL for this HTTP call
5860
* @param params the variables to pass to the API
5961
* @param completeBlock a JSONObjectBlock block to execute upon completion
6062
* @return the JSON response as desrialized object
@@ -66,6 +68,7 @@
6668
/** @name Making POST API requests */
6769
/**
6870
* Makes a POST request to the API
71+
* @param path the URL path to add to the base API URL for this HTTP call
6972
* @param params the variables to pass to the API
7073
* @param err pointer to an NSError object to pass back an error if needed
7174
* @return the JSON response as desrialized object
@@ -74,6 +77,7 @@
7477

7578
/**
7679
* Makes a POST request to the API
80+
* @param path the URL path to add to the base API URL for this HTTP call
7781
* @param params the variables to pass to the API
7882
* @param completeBlock a JSONObjectBlock block to execute upon completion
7983
* @return the JSON response as desrialized object
@@ -85,6 +89,7 @@
8589
/** @name JSON RPC (1.0) request method */
8690
/**
8791
* Makes a synchronious JSON RPC request to the API
92+
* @param method the HTTP method name; GET or POST only
8893
* @param args the list of arguments to pass to the API
8994
* @param err pointer to an NSError object to pass back an error if needed
9095
* @return the JSON response as desrialized object
@@ -93,6 +98,7 @@
9398

9499
/**
95100
* Makes an asynchronious JSON RPC request to the API
101+
* @param method the HTTP method name; GET or POST only
96102
* @param args the list of arguments to pass to the API
97103
* @param completeBlock JSONObjectBlock to execute upon completion
98104
* @return the JSON response as desrialized object

‎JSONModel/JSONModelNetworking/JSONHTTPClient.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ typedef void (^JSONObjectBlock)(NSDictionary* json, JSONModelError* err);
8888
/**
8989
* Makes GET request to the given URL address and fetches a JSON response.
9090
* @param urlString the URL as a string
91+
* @param err a pointer to an NSError object, to pass back an error if needed
9192
* @return JSON compliant object or nil
9293
*/
9394
+(id)getJSONFromURLWithString:(NSString*)urlString error:(NSError**)err;
@@ -96,6 +97,7 @@ typedef void (^JSONObjectBlock)(NSDictionary* json, JSONModelError* err);
9697
* Makes GET request to the given URL address and fetches a JSON response. Sends the params as a query string variables.
9798
* @param urlString the URL as a string
9899
* @param params a dictionary of key / value pairs to be send as variables to the request
100+
* @param err a pointer to an NSError object, to pass back an error if needed
99101
* @return JSON compliant object or nil
100102
*/
101103
+(id)getJSONFromURLWithString:(NSString*)urlString params:(NSDictionary*)params error:(NSError**)err;
@@ -107,6 +109,7 @@ typedef void (^JSONObjectBlock)(NSDictionary* json, JSONModelError* err);
107109
* Makes POST request to the given URL address and fetches a JSON response. Sends the params as url encoded variables via the POST body.
108110
* @param urlString the URL as a string
109111
* @param params a dictionary of key / value pairs to be send as variables to the request
112+
* @param err a pointer to an NSError object, to pass back an error if needed
110113
* @return JSON compliant object or nil
111114
*/
112115
+(id)postJSONFromURLWithString:(NSString*)urlString params:(NSDictionary*)params error:(NSError**)err;
@@ -115,6 +118,7 @@ typedef void (^JSONObjectBlock)(NSDictionary* json, JSONModelError* err);
115118
* Makes POST request to the given URL address and fetches a JSON response. Sends the bodyString param as the POST request body.
116119
* @param urlString the URL as a string
117120
* @param bodyString the body of the POST request as a string
121+
* @param err a pointer to an NSError object, to pass back an error if needed
118122
* @return JSON compliant object or nil
119123
*/
120124
+(id)postJSONFromURLWithString:(NSString*)urlString bodyString:(NSString*)bodyString error:(NSError**)err;

0 commit comments

Comments
 (0)