mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-06 15:40:54 +00:00
Merge pull request #780 from geekerzp/develop_2.0_objc_contenttype
Minor improvement to Objc API Client 'accept' and 'content-type' header
This commit is contained in:
commit
82436c5b44
@ -48,6 +48,9 @@ extern NSString *const SWGResponseObjectErrorKey;
|
|||||||
|
|
||||||
+(void) configureCacheReachibilityForHost:(NSString*)host;
|
+(void) configureCacheReachibilityForHost:(NSString*)host;
|
||||||
|
|
||||||
|
+(NSString *) selectHeaderAccept:(NSArray *)accepts;
|
||||||
|
+(NSString *) selectHeaderContentType:(NSArray *)contentTypes;
|
||||||
|
|
||||||
-(void)setHeaderValue:(NSString*) value
|
-(void)setHeaderValue:(NSString*) value
|
||||||
forKey:(NSString*) forKey;
|
forKey:(NSString*) forKey;
|
||||||
|
|
||||||
|
@ -79,6 +79,51 @@ static bool loggingEnabled = true;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Detect `Accept` from accepts
|
||||||
|
*/
|
||||||
|
+ (NSString *) selectHeaderAccept:(NSArray *)accepts
|
||||||
|
{
|
||||||
|
if (accepts == nil || [accepts count] == 0) {
|
||||||
|
return @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]];
|
||||||
|
[accepts enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||||
|
[lowerAccepts addObject:[obj lowercaseString]];
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
if ([lowerAccepts containsObject:@"application/json"]) {
|
||||||
|
return @"application/json";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [lowerAccepts componentsJoinedByString:@", "];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Detect `Content-Type` from contentTypes
|
||||||
|
*/
|
||||||
|
+ (NSString *) selectHeaderContentType:(NSArray *)contentTypes
|
||||||
|
{
|
||||||
|
if (contentTypes == nil || [contentTypes count] == 0) {
|
||||||
|
return @"application/json";
|
||||||
|
}
|
||||||
|
|
||||||
|
NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]];
|
||||||
|
[contentTypes enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||||
|
[lowerContentTypes addObject:[obj lowercaseString]];
|
||||||
|
}];
|
||||||
|
|
||||||
|
if ([lowerContentTypes containsObject:@"application/json"]) {
|
||||||
|
return @"application/json";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return lowerContentTypes[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
-(void)setHeaderValue:(NSString*) value
|
-(void)setHeaderValue:(NSString*) value
|
||||||
forKey:(NSString*) forKey {
|
forKey:(NSString*) forKey {
|
||||||
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
|
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
|
||||||
|
@ -83,12 +83,6 @@ static NSString * basePath = @"{{basePath}}";
|
|||||||
{{#pathParams}}[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"{{baseName}}", @"}"]] withString: [SWGApiClient escape:{{paramName}}]];
|
{{#pathParams}}[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"{{baseName}}", @"}"]] withString: [SWGApiClient escape:{{paramName}}]];
|
||||||
{{/pathParams}}
|
{{/pathParams}}
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
{{#queryParams}}if({{paramName}} != nil) {
|
{{#queryParams}}if({{paramName}} != nil) {
|
||||||
{{#collectionFormat}}
|
{{#collectionFormat}}
|
||||||
@ -102,6 +96,24 @@ static NSString * basePath = @"{{basePath}}";
|
|||||||
{{#headerParams}}if({{paramName}} != nil)
|
{{#headerParams}}if({{paramName}} != nil)
|
||||||
headerParams[@"{{baseName}}"] = {{paramName}};
|
headerParams[@"{{baseName}}"] = {{paramName}};
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
{{#bodyParam}}
|
{{#bodyParam}}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
BA525648922D4C0E9F44D4F1 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73DA4F1067C343C3962F1542 /* libPods.a */; };
|
BA525648922D4C0E9F44D4F1 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73DA4F1067C343C3962F1542 /* libPods.a */; };
|
||||||
|
CF31D0991B105E4B00509935 /* SWGApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF31D0981B105E4B00509935 /* SWGApiClientTest.m */; };
|
||||||
CFD1B6701B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */; };
|
CFD1B6701B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */; };
|
||||||
CFD1B6711B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */; };
|
CFD1B6711B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */; };
|
||||||
EA66999A1811D2FA00A70D03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699991811D2FA00A70D03 /* Foundation.framework */; };
|
EA66999A1811D2FA00A70D03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699991811D2FA00A70D03 /* Foundation.framework */; };
|
||||||
@ -55,6 +56,7 @@
|
|||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
73DA4F1067C343C3962F1542 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
73DA4F1067C343C3962F1542 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
A425648B5C0A4849C7668069 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "../Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
|
A425648B5C0A4849C7668069 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "../Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
CF31D0981B105E4B00509935 /* SWGApiClientTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClientTest.m; sourceTree = "<group>"; };
|
||||||
CFD1B66E1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JSONValueTransformer+ISO8601.h"; sourceTree = "<group>"; };
|
CFD1B66E1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JSONValueTransformer+ISO8601.h"; sourceTree = "<group>"; };
|
||||||
CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "JSONValueTransformer+ISO8601.m"; sourceTree = "<group>"; };
|
CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "JSONValueTransformer+ISO8601.m"; sourceTree = "<group>"; };
|
||||||
E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "../Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "../Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
@ -207,6 +209,7 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
EA8CD3EB1AC274BE00C47D0B /* PetApiTest.h */,
|
EA8CD3EB1AC274BE00C47D0B /* PetApiTest.h */,
|
||||||
|
CF31D0981B105E4B00509935 /* SWGApiClientTest.m */,
|
||||||
EA6699C71811D2FB00A70D03 /* PetApiTest.m */,
|
EA6699C71811D2FB00A70D03 /* PetApiTest.m */,
|
||||||
EA6699C21811D2FB00A70D03 /* Supporting Files */,
|
EA6699C21811D2FB00A70D03 /* Supporting Files */,
|
||||||
);
|
);
|
||||||
@ -417,6 +420,7 @@
|
|||||||
EAB26B0C1AC8DF78002F5C7A /* PetApiTest.h in Sources */,
|
EAB26B0C1AC8DF78002F5C7A /* PetApiTest.h in Sources */,
|
||||||
CFD1B6711B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */,
|
CFD1B6711B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */,
|
||||||
EAB26B0D1AC8DF78002F5C7A /* PetApiTest.m in Sources */,
|
EAB26B0D1AC8DF78002F5C7A /* PetApiTest.m in Sources */,
|
||||||
|
CF31D0991B105E4B00509935 /* SWGApiClientTest.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <XCTest/XCTest.h>
|
||||||
|
#import "SWGApiClient.h"
|
||||||
|
|
||||||
|
@interface SWGApiClientTest : XCTestCase
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation SWGApiClientTest
|
||||||
|
|
||||||
|
- (void)setUp {
|
||||||
|
[super setUp];
|
||||||
|
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)tearDown {
|
||||||
|
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||||
|
[super tearDown];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testSelectHeaderAccept {
|
||||||
|
NSArray *accepts = nil;
|
||||||
|
|
||||||
|
accepts = @[@"APPLICATION/JSON", @"APPLICATION/XML"];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderAccept:accepts], @"application/json");
|
||||||
|
|
||||||
|
accepts = @[@"application/json", @"application/xml"];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderAccept:accepts], @"application/json");
|
||||||
|
|
||||||
|
accepts = @[@"APPLICATION/xml", @"APPLICATION/json"];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderAccept:accepts], @"application/json");
|
||||||
|
|
||||||
|
accepts = @[@"text/plain", @"application/xml"];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderAccept:accepts], @"text/plain, application/xml");
|
||||||
|
|
||||||
|
accepts = @[];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderAccept:accepts], @"");
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testSelectHeaderContentType {
|
||||||
|
NSArray *contentTypes = nil;
|
||||||
|
|
||||||
|
contentTypes = @[@"APPLICATION/JSON", @"APPLICATION/XML"];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderContentType:contentTypes], @"application/json");
|
||||||
|
|
||||||
|
contentTypes = @[@"application/json", @"application/xml"];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderContentType:contentTypes], @"application/json");
|
||||||
|
|
||||||
|
contentTypes = @[@"APPLICATION/xml", @"APPLICATION/json"];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderContentType:contentTypes], @"application/json");
|
||||||
|
|
||||||
|
contentTypes = @[@"text/plain", @"application/xml"];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderContentType:contentTypes], @"text/plain");
|
||||||
|
|
||||||
|
contentTypes = @[];
|
||||||
|
XCTAssertEqualObjects([SWGApiClient selectHeaderContentType:contentTypes], @"application/json");
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@ -1,23 +1,23 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- AFNetworking (2.5.3):
|
- AFNetworking (2.5.4):
|
||||||
- AFNetworking/NSURLConnection (= 2.5.3)
|
- AFNetworking/NSURLConnection (= 2.5.4)
|
||||||
- AFNetworking/NSURLSession (= 2.5.3)
|
- AFNetworking/NSURLSession (= 2.5.4)
|
||||||
- AFNetworking/Reachability (= 2.5.3)
|
- AFNetworking/Reachability (= 2.5.4)
|
||||||
- AFNetworking/Security (= 2.5.3)
|
- AFNetworking/Security (= 2.5.4)
|
||||||
- AFNetworking/Serialization (= 2.5.3)
|
- AFNetworking/Serialization (= 2.5.4)
|
||||||
- AFNetworking/UIKit (= 2.5.3)
|
- AFNetworking/UIKit (= 2.5.4)
|
||||||
- AFNetworking/NSURLConnection (2.5.3):
|
- AFNetworking/NSURLConnection (2.5.4):
|
||||||
- AFNetworking/Reachability
|
- AFNetworking/Reachability
|
||||||
- AFNetworking/Security
|
- AFNetworking/Security
|
||||||
- AFNetworking/Serialization
|
- AFNetworking/Serialization
|
||||||
- AFNetworking/NSURLSession (2.5.3):
|
- AFNetworking/NSURLSession (2.5.4):
|
||||||
- AFNetworking/Reachability
|
- AFNetworking/Reachability
|
||||||
- AFNetworking/Security
|
- AFNetworking/Security
|
||||||
- AFNetworking/Serialization
|
- AFNetworking/Serialization
|
||||||
- AFNetworking/Reachability (2.5.3)
|
- AFNetworking/Reachability (2.5.4)
|
||||||
- AFNetworking/Security (2.5.3)
|
- AFNetworking/Security (2.5.4)
|
||||||
- AFNetworking/Serialization (2.5.3)
|
- AFNetworking/Serialization (2.5.4)
|
||||||
- AFNetworking/UIKit (2.5.3):
|
- AFNetworking/UIKit (2.5.4):
|
||||||
- AFNetworking/NSURLConnection
|
- AFNetworking/NSURLConnection
|
||||||
- AFNetworking/NSURLSession
|
- AFNetworking/NSURLSession
|
||||||
- ISO8601 (0.2.0)
|
- ISO8601 (0.2.0)
|
||||||
@ -29,8 +29,8 @@ DEPENDENCIES:
|
|||||||
- JSONModel (~> 1.0)
|
- JSONModel (~> 1.0)
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
AFNetworking: e1d86c2a96bb5d2e7408da36149806706ee122fe
|
AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e
|
||||||
ISO8601: 962282de75074c38bbfaa7b133b0e743ed6deb8d
|
ISO8601: 962282de75074c38bbfaa7b133b0e743ed6deb8d
|
||||||
JSONModel: ec77e9865236a7a09d9cf7668df6b4b328d9ec1d
|
JSONModel: ec77e9865236a7a09d9cf7668df6b4b328d9ec1d
|
||||||
|
|
||||||
COCOAPODS: 0.36.0
|
COCOAPODS: 0.37.1
|
||||||
|
@ -48,6 +48,9 @@ extern NSString *const SWGResponseObjectErrorKey;
|
|||||||
|
|
||||||
+(void) configureCacheReachibilityForHost:(NSString*)host;
|
+(void) configureCacheReachibilityForHost:(NSString*)host;
|
||||||
|
|
||||||
|
+(NSString *) selectHeaderAccept:(NSArray *)accepts;
|
||||||
|
+(NSString *) selectHeaderContentType:(NSArray *)contentTypes;
|
||||||
|
|
||||||
-(void)setHeaderValue:(NSString*) value
|
-(void)setHeaderValue:(NSString*) value
|
||||||
forKey:(NSString*) forKey;
|
forKey:(NSString*) forKey;
|
||||||
|
|
||||||
|
@ -79,6 +79,51 @@ static bool loggingEnabled = true;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Detect `Accept` from accepts
|
||||||
|
*/
|
||||||
|
+ (NSString *) selectHeaderAccept:(NSArray *)accepts
|
||||||
|
{
|
||||||
|
if (accepts == nil || [accepts count] == 0) {
|
||||||
|
return @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]];
|
||||||
|
[accepts enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||||
|
[lowerAccepts addObject:[obj lowercaseString]];
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
if ([lowerAccepts containsObject:@"application/json"]) {
|
||||||
|
return @"application/json";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [lowerAccepts componentsJoinedByString:@", "];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Detect `Content-Type` from contentTypes
|
||||||
|
*/
|
||||||
|
+ (NSString *) selectHeaderContentType:(NSArray *)contentTypes
|
||||||
|
{
|
||||||
|
if (contentTypes == nil || [contentTypes count] == 0) {
|
||||||
|
return @"application/json";
|
||||||
|
}
|
||||||
|
|
||||||
|
NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]];
|
||||||
|
[contentTypes enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||||
|
[lowerContentTypes addObject:[obj lowercaseString]];
|
||||||
|
}];
|
||||||
|
|
||||||
|
if ([lowerContentTypes containsObject:@"application/json"]) {
|
||||||
|
return @"application/json";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return lowerContentTypes[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
-(void)setHeaderValue:(NSString*) value
|
-(void)setHeaderValue:(NSString*) value
|
||||||
forKey:(NSString*) forKey {
|
forKey:(NSString*) forKey {
|
||||||
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
|
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
|
||||||
|
@ -77,17 +77,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -170,17 +182,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -263,12 +287,6 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
if(status != nil) {
|
if(status != nil) {
|
||||||
|
|
||||||
@ -280,6 +298,24 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -352,12 +388,6 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
if(tags != nil) {
|
if(tags != nil) {
|
||||||
|
|
||||||
@ -369,6 +399,24 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -445,17 +493,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -537,17 +597,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[@"application/x-www-form-urlencoded"];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/x-www-form-urlencoded"]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -629,12 +701,6 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
@ -642,6 +708,24 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
if(apiKey != nil)
|
if(apiKey != nil)
|
||||||
headerParams[@"api_key"] = apiKey;
|
headerParams[@"api_key"] = apiKey;
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -709,17 +793,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[@"multipart/form-data"];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"multipart/form-data"]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
|
@ -74,17 +74,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -150,17 +162,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -261,17 +285,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"orderId", @"}"]] withString: [SWGApiClient escape:orderId]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"orderId", @"}"]] withString: [SWGApiClient escape:orderId]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -349,17 +385,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"orderId", @"}"]] withString: [SWGApiClient escape:orderId]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"orderId", @"}"]] withString: [SWGApiClient escape:orderId]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
|
@ -76,17 +76,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -169,17 +181,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -262,17 +286,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -357,12 +393,6 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
if(username != nil) {
|
if(username != nil) {
|
||||||
|
|
||||||
@ -376,6 +406,24 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -445,17 +493,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -519,17 +579,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -609,17 +681,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
@ -706,17 +790,29 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
|
|||||||
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]];
|
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]];
|
||||||
|
|
||||||
|
|
||||||
NSArray* requestContentTypes = @[];
|
|
||||||
NSString* requestContentType = [requestContentTypes count] > 0 ? requestContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSArray* responseContentTypes = @[@"application/json", @"application/xml"];
|
|
||||||
NSString* responseContentType = [responseContentTypes count] > 0 ? responseContentTypes[0] : @"application/json";
|
|
||||||
|
|
||||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// HTTP header `Accept`
|
||||||
|
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
|
||||||
|
if ([headerParams[@"Accept"] length] == 0) {
|
||||||
|
[headerParams removeObjectForKey:@"Accept"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// response content type
|
||||||
|
NSString *responseContentType;
|
||||||
|
if ([headerParams objectForKey:@"Accept"]) {
|
||||||
|
responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
responseContentType = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// request content type
|
||||||
|
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||||
|
|
||||||
id bodyDictionary = nil;
|
id bodyDictionary = nil;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user