forked from loafle/openapi-generator-original
Update ObjC petstore and test cases (#139)
* restore objc samples from codegen 2x * update objc petstore test * update objc with oas3 petstore
This commit is contained in:
parent
231547f6c7
commit
9fdcb3681b
@ -69,7 +69,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
|
||||
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||
|
||||
|
||||
SWGPet *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
|
||||
SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
|
||||
|
||||
SWGPetApi *apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
|
@ -31,7 +31,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
|
||||
/// code:405 message:"Invalid input"
|
||||
///
|
||||
/// @return void
|
||||
-(NSURLSessionTask*) addPetWithPet: (SWGPet) pet
|
||||
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
|
||||
/// code:405 message:"Validation exception"
|
||||
///
|
||||
/// @return void
|
||||
-(NSURLSessionTask*) updatePetWithPet: (SWGPet) pet
|
||||
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSURLSessionTask*) addPetWithPet: (SWGPet) pet
|
||||
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
|
||||
|
||||
@ -367,7 +367,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSURLSessionTask*) updatePetWithPet: (SWGPet) pet
|
||||
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];
|
||||
|
||||
|
@ -70,7 +70,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode;
|
||||
/// code:400 message:"Invalid Order"
|
||||
///
|
||||
/// @return SWGOrder*
|
||||
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder) order
|
||||
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
|
||||
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
|
||||
|
||||
|
||||
|
@ -244,7 +244,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513;
|
||||
///
|
||||
/// @returns SWGOrder*
|
||||
///
|
||||
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder) order
|
||||
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
|
||||
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"];
|
||||
|
||||
|
@ -31,7 +31,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
|
||||
/// code:0 message:"successful operation"
|
||||
///
|
||||
/// @return void
|
||||
-(NSURLSessionTask*) createUserWithUser: (SWGUser) user
|
||||
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
|
||||
///
|
||||
/// @return void
|
||||
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
|
||||
user: (SWGUser) user
|
||||
user: (SWGUser*) user
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
|
||||
///
|
||||
/// @returns void
|
||||
///
|
||||
-(NSURLSessionTask*) createUserWithUser: (SWGUser) user
|
||||
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"];
|
||||
|
||||
@ -475,7 +475,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513;
|
||||
/// @returns void
|
||||
///
|
||||
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
|
||||
user: (SWGUser) user
|
||||
user: (SWGUser*) user
|
||||
completionHandler: (void (^)(NSError* error)) handler {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == nil) {
|
||||
|
@ -34,7 +34,7 @@
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetById"];
|
||||
SWGPet* pet = [self createPet];
|
||||
|
||||
[api addPetWithBody:pet completionHandler:^(NSError *error) {
|
||||
[api addPetWithPet:pet completionHandler:^(NSError *error) {
|
||||
if(error){
|
||||
XCTFail(@"got error %@", error);
|
||||
}
|
||||
@ -74,7 +74,7 @@
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"testUpdatePet"];
|
||||
SWGPet* pet = [self createPet];
|
||||
|
||||
[api addPetWithBody:pet completionHandler:^(NSError *error) {
|
||||
[api addPetWithPet:pet completionHandler:^(NSError *error) {
|
||||
if(error) {
|
||||
XCTFail(@"got error %@", error);
|
||||
}
|
||||
@ -93,7 +93,7 @@
|
||||
[pet setName:@"programmer"];
|
||||
[pet setStatus:@"confused"];
|
||||
|
||||
[api updatePetWithBody:pet
|
||||
[api updatePetWithPet:pet
|
||||
completionHandler:^(NSError *error) {
|
||||
if(error) {
|
||||
XCTFail(@"got error %@", error);
|
||||
@ -166,7 +166,7 @@ which causes an exception when deserializing the data
|
||||
NSLog(@"%@", pet._id);
|
||||
pet.tags = (id) @[tag];
|
||||
|
||||
[api addPetWithBody:pet completionHandler:^(NSError *error) {
|
||||
[api addPetWithPet:pet completionHandler:^(NSError *error) {
|
||||
if(error) {
|
||||
XCTFail(@"got error %@", error);
|
||||
}
|
||||
@ -199,7 +199,7 @@ which causes an exception when deserializing the data
|
||||
|
||||
SWGPet* pet = [self createPet];
|
||||
|
||||
[api addPetWithBody:pet completionHandler:^(NSError *error) {
|
||||
[api addPetWithPet:pet completionHandler:^(NSError *error) {
|
||||
if(error){
|
||||
XCTFail(@"got error %@", error);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ Method | HTTP request | Description
|
||||
|
||||
# **addPet**
|
||||
```objc
|
||||
-(NSURLSessionTask*) addPetWithPet: (SWGPet) pet
|
||||
-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
```
|
||||
|
||||
@ -30,7 +30,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
|
||||
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||
|
||||
|
||||
SWGPet pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
|
||||
SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
|
||||
|
||||
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
@ -47,7 +47,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**SWGPet**](SWGPet.md)| Pet object that needs to be added to the store | [optional]
|
||||
**pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -81,7 +81,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
|
||||
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||
|
||||
|
||||
NSNumber* petId = @789; // Pet id to delete
|
||||
NSNumber* petId = @56; // Pet id to delete
|
||||
NSString* apiKey = @"apiKey_example"; // (optional)
|
||||
|
||||
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
@ -251,7 +251,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
|
||||
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||
|
||||
|
||||
NSNumber* petId = @789; // ID of pet that needs to be fetched
|
||||
NSNumber* petId = @56; // ID of pet that needs to be fetched
|
||||
|
||||
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
@ -290,7 +290,7 @@ Name | Type | Description | Notes
|
||||
|
||||
# **updatePet**
|
||||
```objc
|
||||
-(NSURLSessionTask*) updatePetWithPet: (SWGPet) pet
|
||||
-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
```
|
||||
|
||||
@ -304,7 +304,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
|
||||
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||
|
||||
|
||||
SWGPet pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
|
||||
SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
|
||||
|
||||
SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
@ -321,7 +321,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**SWGPet**](SWGPet.md)| Pet object that needs to be added to the store | [optional]
|
||||
**pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -414,7 +414,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];
|
||||
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||
|
||||
|
||||
NSNumber* petId = @789; // ID of pet to update
|
||||
NSNumber* petId = @56; // ID of pet to update
|
||||
NSString* additionalMetadata = @"additionalMetadata_example"; // Additional data to pass to server (optional)
|
||||
NSURL* file = [NSURL fileURLWithPath:@"/path/to/file"]; // file to upload (optional)
|
||||
|
||||
|
@ -162,7 +162,7 @@ No authorization required
|
||||
|
||||
# **placeOrder**
|
||||
```objc
|
||||
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder) order
|
||||
-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order
|
||||
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler;
|
||||
```
|
||||
|
||||
@ -171,7 +171,7 @@ Place an order for a pet
|
||||
### Example
|
||||
```objc
|
||||
|
||||
SWGOrder order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional)
|
||||
SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional)
|
||||
|
||||
SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
|
||||
|
||||
@ -191,7 +191,7 @@ SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init];
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**order** | [**SWGOrder**](SWGOrder.md)| order placed for purchasing the pet | [optional]
|
||||
**order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -16,7 +16,7 @@ Method | HTTP request | Description
|
||||
|
||||
# **createUser**
|
||||
```objc
|
||||
-(NSURLSessionTask*) createUserWithUser: (SWGUser) user
|
||||
-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
```
|
||||
|
||||
@ -27,7 +27,7 @@ This can only be done by the logged in user.
|
||||
### Example
|
||||
```objc
|
||||
|
||||
SWGUser user = [[SWGUser alloc] init]; // Created user object (optional)
|
||||
SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional)
|
||||
|
||||
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
|
||||
@ -44,7 +44,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**SWGUser**](SWGUser.md)| Created user object | [optional]
|
||||
**user** | [**SWGUser***](SWGUser.md)| Created user object | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -72,7 +72,7 @@ Creates list of users with given input array
|
||||
### Example
|
||||
```objc
|
||||
|
||||
NSArray<SWGUser>* user = @[[[SWGUser alloc] init]]; // List of user object (optional)
|
||||
NSArray<SWGUser>* user = @[[[NSArray alloc] init]]; // List of user object (optional)
|
||||
|
||||
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
|
||||
@ -89,7 +89,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional]
|
||||
**user** | [**NSArray<SWGUser>***](NSArray.md)| List of user object | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -117,7 +117,7 @@ Creates list of users with given input array
|
||||
### Example
|
||||
```objc
|
||||
|
||||
NSArray<SWGUser>* user = @[[[SWGUser alloc] init]]; // List of user object (optional)
|
||||
NSArray<SWGUser>* user = @[[[NSArray alloc] init]]; // List of user object (optional)
|
||||
|
||||
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
|
||||
@ -134,7 +134,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional]
|
||||
**user** | [**NSArray<SWGUser>***](NSArray.md)| List of user object | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -342,7 +342,7 @@ No authorization required
|
||||
# **updateUser**
|
||||
```objc
|
||||
-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username
|
||||
user: (SWGUser) user
|
||||
user: (SWGUser*) user
|
||||
completionHandler: (void (^)(NSError* error)) handler;
|
||||
```
|
||||
|
||||
@ -354,7 +354,7 @@ This can only be done by the logged in user.
|
||||
```objc
|
||||
|
||||
NSString* username = @"username_example"; // name that need to be deleted
|
||||
SWGUser user = [[SWGUser alloc] init]; // Updated user object (optional)
|
||||
SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional)
|
||||
|
||||
SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
|
||||
@ -373,7 +373,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init];
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **NSString***| name that need to be deleted |
|
||||
**user** | [**SWGUser**](SWGUser.md)| Updated user object | [optional]
|
||||
**user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user