File tree Expand file tree Collapse file tree 6 files changed +48
-2
lines changed
modules/swagger-codegen/src/main/resources/objc
samples/client/petstore/objc/SwaggerClient Expand file tree Collapse file tree 6 files changed +48
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ static void (^reachabilityChangeBlock)(int);
53
53
cacheEnabled = enabled;
54
54
}
55
55
56
+ +(void) setReachabilityStatus:(AFNetworkReachabilityStatus)status {
57
+ reachabilityStatus = status;
58
+ }
59
+
56
60
- (void)setHeaderValue:(NSString*) value
57
61
forKey:(NSString*) forKey {
58
62
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
@@ -238,6 +242,10 @@ static void (^reachabilityChangeBlock)(int);
238
242
return reachabilityStatus;
239
243
}
240
244
245
+ +(bool) getOfflineState {
246
+ return offlineState;
247
+ }
248
+
241
249
+(void) setReachabilityChangeBlock:(void(^)(int))changeBlock {
242
250
reachabilityChangeBlock = changeBlock;
243
251
}
Original file line number Diff line number Diff line change @@ -64,6 +64,20 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey;
64
64
*/
65
65
+(void) setOfflineState:(BOOL) state;
66
66
67
+ /**
68
+ * Gets if the client is unreachable
69
+ *
70
+ * @return The client offline state
71
+ */
72
+ +(bool) getOfflineState;
73
+
74
+ /**
75
+ * Sets the client reachability, this may be overridden by the reachability manager if reachability changes
76
+ *
77
+ * @param The client reachability.
78
+ */
79
+ +(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status;
80
+
67
81
/**
68
82
* Gets the client reachability
69
83
*
Original file line number Diff line number Diff line change @@ -73,6 +73,20 @@ extern NSString *const SWGResponseObjectErrorKey;
73
73
*/
74
74
+(void ) setOfflineState : (BOOL ) state ;
75
75
76
+ /* *
77
+ * Gets if the client is unreachable
78
+ *
79
+ * @return The client offline state
80
+ */
81
+ +(bool ) getOfflineState ;
82
+
83
+ /* *
84
+ * Sets the client reachability, this may be override by the reachability manager if reachability changes
85
+ *
86
+ * @param The client reachability.
87
+ */
88
+ +(void ) setReachabilityStatus : (AFNetworkReachabilityStatus) status ;
89
+
76
90
/* *
77
91
* Gets the client reachability
78
92
*
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ + (void) setCacheEnabled:(BOOL)enabled {
53
53
cacheEnabled = enabled;
54
54
}
55
55
56
+ +(void ) setReachabilityStatus : (AFNetworkReachabilityStatus)status {
57
+ reachabilityStatus = status;
58
+ }
59
+
56
60
- (void )setHeaderValue : (NSString *) value
57
61
forKey : (NSString *) forKey {
58
62
[self .requestSerializer setValue: value forHTTPHeaderField: forKey];
@@ -238,6 +242,10 @@ +(AFNetworkReachabilityStatus) getReachabilityStatus {
238
242
return reachabilityStatus;
239
243
}
240
244
245
+ +(bool ) getOfflineState {
246
+ return offlineState;
247
+ }
248
+
241
249
+(void ) setReachabilityChangeBlock : (void (^)(int ))changeBlock {
242
250
reachabilityChangeBlock = changeBlock;
243
251
}
Original file line number Diff line number Diff line change 17
17
18
18
@property (nonatomic ) NSNumber * name;
19
19
20
+ @property (nonatomic ) NSNumber * snakeCase;
21
+
20
22
@end
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ - (instancetype)init {
20
20
*/
21
21
+ (JSONKeyMapper *)keyMapper
22
22
{
23
- return [[JSONKeyMapper alloc ] initWithDictionary: @{ @" name" : @" name" }];
23
+ return [[JSONKeyMapper alloc ] initWithDictionary: @{ @" name" : @" name" , @" snake_case " : @" snakeCase " }];
24
24
}
25
25
26
26
/* *
@@ -30,7 +30,7 @@ + (JSONKeyMapper *)keyMapper
30
30
*/
31
31
+ (BOOL )propertyIsOptional : (NSString *)propertyName
32
32
{
33
- NSArray *optionalProperties = @[@" name" ];
33
+ NSArray *optionalProperties = @[@" name" , @" snakeCase " ];
34
34
35
35
if ([optionalProperties containsObject: propertyName]) {
36
36
return YES ;
You can’t perform that action at this time.
0 commit comments