forked from loafle/openapi-generator-original
[ObjC] Fix various bugs in generated code. (#3031)
* [ObjC] Fix bug where ApiClient.timeoutInterval didn't do anything. * [ObjC] Fix bug where <AFNetworking.h> couldn't be found. * [ObjC] Fix useages of 'SWG' instead of {{classPrefix}} in Sanitizer-body.mustache.
This commit is contained in:
parent
a3610f1c12
commit
689841ce8e
@ -50,6 +50,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response)
|
||||
- (instancetype)initWithBaseURL:(NSURL *)url {
|
||||
self = [super initWithBaseURL:url];
|
||||
if (self) {
|
||||
self.timeoutInterval = 60;
|
||||
self.requestSerializer = [AFJSONRequestSerializer serializer];
|
||||
self.responseSerializer = [AFJSONResponseSerializer serializer];
|
||||
self.securityPolicy = [self customSecurityPolicy];
|
||||
@ -87,6 +88,11 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response)
|
||||
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
|
||||
}
|
||||
|
||||
- (void)setRequestSerializer:(AFHTTPRequestSerializer<AFURLRequestSerialization> *)requestSerializer {
|
||||
[super setRequestSerializer:requestSerializer];
|
||||
requestSerializer.timeoutInterval = self.timeoutInterval;
|
||||
}
|
||||
|
||||
#pragma mark - Cache Methods
|
||||
|
||||
+(void)clearCache {
|
||||
|
@ -1,6 +1,6 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <ISO8601/ISO8601.h>
|
||||
#import <AFNetworking.h>
|
||||
#import <AFNetworking/AFNetworking.h>
|
||||
#import "{{classPrefix}}JSONResponseSerializer.h"
|
||||
#import "{{classPrefix}}JSONRequestSerializer.h"
|
||||
#import "{{classPrefix}}QueryParamCollection.h"
|
||||
|
@ -35,13 +35,13 @@ NSString * {{classPrefix}}PercentEscapedStringFromString(NSString *string) {
|
||||
return escaped;
|
||||
}
|
||||
|
||||
@interface SWGSanitizer ()
|
||||
@interface {{classPrefix}}Sanitizer ()
|
||||
|
||||
@property (nonatomic, strong) NSRegularExpression* jsonHeaderTypeExpression;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SWGSanitizer
|
||||
@implementation {{classPrefix}}Sanitizer
|
||||
|
||||
static NSString * kApplicationJSONType = @"application/json";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user