mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 22:22:52 +00:00
add test case to python, better resered word handling for objc
This commit is contained in:
@@ -136,7 +136,8 @@ static void (^reachabilityChangeBlock)(int);
|
||||
NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]];
|
||||
for (NSString *string in accepts) {
|
||||
NSString * lowerAccept = [string lowercaseString];
|
||||
if ([lowerAccept containsString:@"application/json"]) {
|
||||
// use rangeOfString instead of containsString for iOS 7 support
|
||||
if ([lowerAccept rangeOfString:@"application/json"].location != NSNotFound) {
|
||||
return @"application/json";
|
||||
}
|
||||
[lowerAccepts addObject:lowerAccept];
|
||||
|
||||
@@ -107,6 +107,13 @@
|
||||
|
||||
- (NSDictionary *) authSettings {
|
||||
return @{
|
||||
@"test_api_key_header":
|
||||
@{
|
||||
@"type": @"api_key",
|
||||
@"in": @"header",
|
||||
@"key": @"test_api_key_header",
|
||||
@"value": [self getApiKeyWithPrefix:@"test_api_key_header"]
|
||||
},
|
||||
@"api_key":
|
||||
@{
|
||||
@"type": @"api_key",
|
||||
@@ -114,6 +121,27 @@
|
||||
@"key": @"api_key",
|
||||
@"value": [self getApiKeyWithPrefix:@"api_key"]
|
||||
},
|
||||
@"test_api_client_secret":
|
||||
@{
|
||||
@"type": @"api_key",
|
||||
@"in": @"header",
|
||||
@"key": @"x-test_api_client_secret",
|
||||
@"value": [self getApiKeyWithPrefix:@"x-test_api_client_secret"]
|
||||
},
|
||||
@"test_api_client_id":
|
||||
@{
|
||||
@"type": @"api_key",
|
||||
@"in": @"header",
|
||||
@"key": @"x-test_api_client_id",
|
||||
@"value": [self getApiKeyWithPrefix:@"x-test_api_client_id"]
|
||||
},
|
||||
@"test_api_key_query":
|
||||
@{
|
||||
@"type": @"api_key",
|
||||
@"in": @"query",
|
||||
@"key": @"test_api_key_query",
|
||||
@"value": [self getApiKeyWithPrefix:@"test_api_key_query"]
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
///
|
||||
///
|
||||
/// @return NSString*
|
||||
-(NSNumber*) getPetByIdWithByteArrayWithPetId: (NSNumber*) petId
|
||||
-(NSNumber*) petPetIdtestingByteArraytrueGetWithPetId: (NSNumber*) petId
|
||||
completionHandler: (void (^)(NSString* output, NSError* error)) handler;
|
||||
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ static SWGPetApi* singletonAPI = nil;
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"api_key"];
|
||||
NSArray *authSettings = @[@"api_key", @"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
@@ -760,13 +760,13 @@ static SWGPetApi* singletonAPI = nil;
|
||||
///
|
||||
/// @returns NSString*
|
||||
///
|
||||
-(NSNumber*) getPetByIdWithByteArrayWithPetId: (NSNumber*) petId
|
||||
-(NSNumber*) petPetIdtestingByteArraytrueGetWithPetId: (NSNumber*) petId
|
||||
completionHandler: (void (^)(NSString* output, NSError* error)) handler {
|
||||
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == nil) {
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `getPetByIdWithByteArray`"];
|
||||
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `petPetIdtestingByteArraytrueGet`"];
|
||||
}
|
||||
|
||||
|
||||
@@ -808,7 +808,7 @@ static SWGPetApi* singletonAPI = nil;
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"api_key"];
|
||||
NSArray *authSettings = @[@"api_key", @"petstore_auth"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
@@ -189,7 +189,7 @@ static SWGStoreApi* singletonAPI = nil;
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[];
|
||||
NSArray *authSettings = @[@"test_api_client_id", @"test_api_client_secret"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
@@ -272,7 +272,7 @@ static SWGStoreApi* singletonAPI = nil;
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[];
|
||||
NSArray *authSettings = @[@"test_api_key_header", @"test_api_key_query"];
|
||||
|
||||
id bodyParam = nil;
|
||||
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
|
||||
|
||||
Reference in New Issue
Block a user