From 204c05442dd0dd5d16f32805e67b9fb0b1c94e1d Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 20 Dec 2016 19:13:03 +0800 Subject: [PATCH] [ObjC] minor code style enhancement to ObjC API client (#4437) * minor code style enhancement to objc api client * update petstore sample * remove datatype from docstring (objc) --- .../src/main/resources/objc/api-body.mustache | 15 +++-- .../main/resources/objc/api-header.mustache | 21 ++++--- .../client/petstore/objc/core-data/README.md | 2 +- .../core-data/SwaggerClient/Api/SWGPetApi.h | 29 --------- .../core-data/SwaggerClient/Api/SWGPetApi.m | 60 +++++++++--------- .../core-data/SwaggerClient/Api/SWGStoreApi.h | 13 ---- .../core-data/SwaggerClient/Api/SWGStoreApi.m | 26 ++++---- .../core-data/SwaggerClient/Api/SWGUserApi.h | 30 --------- .../core-data/SwaggerClient/Api/SWGUserApi.m | 50 +++++++-------- .../default/SwaggerClient/Api/SWGPetApi.h | 24 ------- .../default/SwaggerClient/Api/SWGPetApi.m | 62 +++++++++---------- .../default/SwaggerClient/Api/SWGStoreApi.h | 12 ---- .../default/SwaggerClient/Api/SWGStoreApi.m | 26 ++++---- .../default/SwaggerClient/Api/SWGUserApi.h | 24 ------- .../default/SwaggerClient/Api/SWGUserApi.m | 50 +++++++-------- .../petstore/objc/default/docs/SWGPetApi.md | 10 +-- 16 files changed, 166 insertions(+), 288 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache index 57fdc4ae6a7..4d3148bdbb6 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache @@ -75,11 +75,17 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; /// /// {{{summary}}} /// {{{notes}}} -/// {{#allParams}} @param {{paramName}} {{{description}}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{#allParams}} +/// @param {{paramName}} {{{description}}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} /// -/// {{/allParams}} @returns {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} -/// --(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} +{{/allParams}} +{{#responses}} +/// code:{{{code}}} message:"{{{message}}}"{{#hasMore}},{{/hasMore}} +{{/responses}} +{{#returnType}} +/// @return {{{returnType}}} +{{/returnType}} +-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{operationId}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}} {{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler { {{#allParams}} @@ -181,6 +187,5 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; {{/operation}} -{{newline}} {{/operations}} @end diff --git a/modules/swagger-codegen/src/main/resources/objc/api-header.mustache b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache index 2bd3cd2f490..68c987633f4 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache @@ -16,18 +16,23 @@ extern NSInteger k{{classname}}MissingParamErrorCode; {{#operations}} {{#operation}} /// {{{summary}}} -/// {{#notes}}{{{notes}}}{{/notes}} +{{#notes}} +/// {{{notes}}} +{{/notes}} /// -/// {{#allParams}}@param {{paramName}} {{description}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} -/// {{/allParams}}{{#responses}} -/// code:{{{code}}} message:"{{{message}}}"{{#hasMore}},{{/hasMore}}{{/responses}} -///{{#returnType}} -/// @return {{{returnType}}}{{/returnType}} --(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} +{{#allParams}} +/// @param {{paramName}} {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} +{{/allParams}} +{{#responses}} +/// code:{{{code}}} message:"{{{message}}}"{{#hasMore}},{{/hasMore}} +{{/responses}} +{{#returnType}} +/// @return {{{returnType}}} +{{/returnType}} +-(NSNumber*) {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{operationId}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}} {{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler; -{{newline}} {{/operation}} {{/operations}} diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index 20e27d6fa0a..c59d5182287 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi - API version: 1.0.0 - Package version: -- Build package: class io.swagger.codegen.languages.ObjcClientCodegen +- Build package: io.swagger.codegen.languages.ObjcClientCodegen ## Requirements diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h index e20ae3f380e..719d193130b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -27,113 +27,84 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// /// @param body Pet object that needs to be added to the store (optional) -/// /// code:405 message:"Invalid input" -/// -/// @return -(NSNumber*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; - /// Deletes a pet /// /// /// @param petId Pet id to delete /// @param apiKey (optional) -/// /// code:400 message:"Invalid pet value" -/// -/// @return -(NSNumber*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler; - /// Finds Pets by status /// Multiple status values can be provided with comma separated strings /// /// @param status Status values that need to be considered for filter (optional) (default to available) -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid status value" -/// /// @return NSArray* -(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - /// Finds Pets by tags /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// @param tags Tags to filter by (optional) -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid tag value" -/// /// @return NSArray* -(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - /// Find pet by ID /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions /// /// @param petId ID of pet that needs to be fetched -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found" -/// /// @return SWGPet* -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; - /// Update an existing pet /// /// /// @param body Pet object that needs to be added to the store (optional) -/// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" -/// -/// @return -(NSNumber*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; - /// Updates a pet in the store with form data /// /// /// @param petId ID of pet that needs to be updated /// @param name Updated name of the pet (optional) /// @param status Updated status of the pet (optional) -/// /// code:405 message:"Invalid input" -/// -/// @return -(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler; - /// uploads an image /// /// /// @param petId ID of pet to update /// @param additionalMetadata Additional data to pass to server (optional) /// @param file file to upload (optional) -/// /// code:0 message:"successful operation" -/// -/// @return -(NSNumber*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file completionHandler: (void (^)(NSError* error)) handler; - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index 76d707cdb42..fb0421c81fd 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -72,10 +72,9 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Add a new pet to the store /// -/// @param body Pet object that needs to be added to the store (optional) -/// -/// @returns void +/// @param body Pet object that needs to be added to the store (optional) /// +/// code:405 message:"Invalid input" -(NSNumber*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -131,12 +130,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Deletes a pet /// -/// @param petId Pet id to delete +/// @param petId Pet id to delete /// -/// @param apiKey (optional) -/// -/// @returns void +/// @param apiKey (optional) /// +/// code:400 message:"Invalid pet value" -(NSNumber*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler { @@ -209,10 +207,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by status /// Multiple status values can be provided with comma separated strings -/// @param status Status values that need to be considered for filter (optional, default to available) -/// -/// @returns NSArray* +/// @param status Status values that need to be considered for filter (optional, default to available) /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid status value" +/// @return NSArray* -(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; @@ -271,10 +270,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by tags /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -/// @param tags Tags to filter by (optional) -/// -/// @returns NSArray* +/// @param tags Tags to filter by (optional) /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid tag value" +/// @return NSArray* -(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; @@ -333,10 +333,12 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Find pet by ID /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// @param petId ID of pet that needs to be fetched -/// -/// @returns SWGPet* +/// @param petId ID of pet that needs to be fetched /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found" +/// @return SWGPet* -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { // verify the required parameter 'petId' is set @@ -405,10 +407,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Update an existing pet /// -/// @param body Pet object that needs to be added to the store (optional) -/// -/// @returns void +/// @param body Pet object that needs to be added to the store (optional) /// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found", +/// code:405 message:"Validation exception" -(NSNumber*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -464,14 +467,13 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Updates a pet in the store with form data /// -/// @param petId ID of pet that needs to be updated +/// @param petId ID of pet that needs to be updated /// -/// @param name Updated name of the pet (optional) +/// @param name Updated name of the pet (optional) /// -/// @param status Updated status of the pet (optional) -/// -/// @returns void +/// @param status Updated status of the pet (optional) /// +/// code:405 message:"Invalid input" -(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status @@ -548,14 +550,13 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// uploads an image /// -/// @param petId ID of pet to update +/// @param petId ID of pet to update /// -/// @param additionalMetadata Additional data to pass to server (optional) +/// @param additionalMetadata Additional data to pass to server (optional) /// -/// @param file file to upload (optional) -/// -/// @returns void +/// @param file file to upload (optional) /// +/// code:0 message:"successful operation" -(NSNumber*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file @@ -628,5 +629,4 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; } - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h index 4ee54d53306..3e101bed9a7 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -27,52 +27,39 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// @param orderId ID of the order that needs to be deleted -/// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Order not found" -/// -/// @return -(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler; - /// Returns pet inventories by status /// Returns a map of status codes to quantities /// -/// /// code:200 message:"successful operation" -/// /// @return NSDictionary* -(NSNumber*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler; - /// Find purchase order by ID /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// @param orderId ID of pet that needs to be fetched -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid ID supplied", /// code:404 message:"Order not found" -/// /// @return SWGOrder* -(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; - /// Place an order for a pet /// /// /// @param body order placed for purchasing the pet (optional) -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" -/// /// @return SWGOrder* -(NSNumber*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m index e5964200f20..b86920b29e2 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m @@ -72,10 +72,10 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Delete purchase order by ID /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -/// @param orderId ID of the order that needs to be deleted -/// -/// @returns void +/// @param orderId ID of the order that needs to be deleted /// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" -(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'orderId' is set @@ -144,8 +144,8 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Returns pet inventories by status /// Returns a map of status codes to quantities -/// @returns NSDictionary* -/// +/// code:200 message:"successful operation" +/// @return NSDictionary* -(NSNumber*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; @@ -200,10 +200,12 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Find purchase order by ID /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -/// @param orderId ID of pet that needs to be fetched -/// -/// @returns SWGOrder* +/// @param orderId ID of pet that needs to be fetched /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// @return SWGOrder* -(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { // verify the required parameter 'orderId' is set @@ -272,10 +274,11 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Place an order for a pet /// -/// @param body order placed for purchasing the pet (optional) -/// -/// @returns SWGOrder* +/// @param body order placed for purchasing the pet (optional) /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid Order" +/// @return SWGOrder* -(NSNumber*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -329,5 +332,4 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; } - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h index d3965216137..f0b5e37550b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -27,105 +27,75 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param body Created user object (optional) -/// /// code:0 message:"successful operation" -/// -/// @return -(NSNumber*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; - /// Creates list of users with given input array /// /// /// @param body List of user object (optional) -/// /// code:0 message:"successful operation" -/// -/// @return -(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; - /// Creates list of users with given input array /// /// /// @param body List of user object (optional) -/// /// code:0 message:"successful operation" -/// -/// @return -(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; - /// Delete user /// This can only be done by the logged in user. /// /// @param username The name that needs to be deleted -/// /// code:400 message:"Invalid username supplied", /// code:404 message:"User not found" -/// -/// @return -(NSNumber*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler; - /// Get user by user name /// /// /// @param username The name that needs to be fetched. Use user1 for testing. -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid username supplied", /// code:404 message:"User not found" -/// /// @return SWGUser* -(NSNumber*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; - /// Logs user into the system /// /// /// @param username The user name for login (optional) /// @param password The password for login in clear text (optional) -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid username/password supplied" -/// /// @return NSString* -(NSNumber*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler; - /// Logs out current logged in user session /// /// -/// /// code:0 message:"successful operation" -/// -/// @return -(NSNumber*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler; - /// Updated user /// This can only be done by the logged in user. /// /// @param username name that need to be deleted /// @param body Updated user object (optional) -/// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" -/// -/// @return -(NSNumber*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m index 6ffb578ed76..df056030b75 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m @@ -72,10 +72,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Create user /// This can only be done by the logged in user. -/// @param body Created user object (optional) -/// -/// @returns void +/// @param body Created user object (optional) /// +/// code:0 message:"successful operation" -(NSNumber*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -131,10 +130,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) -/// -/// @returns void +/// @param body List of user object (optional) /// +/// code:0 message:"successful operation" -(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -190,10 +188,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) -/// -/// @returns void +/// @param body List of user object (optional) /// +/// code:0 message:"successful operation" -(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -249,10 +246,10 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Delete user /// This can only be done by the logged in user. -/// @param username The name that needs to be deleted -/// -/// @returns void +/// @param username The name that needs to be deleted /// +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" -(NSNumber*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set @@ -321,10 +318,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Get user by user name /// -/// @param username The name that needs to be fetched. Use user1 for testing. -/// -/// @returns SWGUser* +/// @param username The name that needs to be fetched. Use user1 for testing. /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// @return SWGUser* -(NSNumber*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { // verify the required parameter 'username' is set @@ -393,12 +392,13 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Logs user into the system /// -/// @param username The user name for login (optional) +/// @param username The user name for login (optional) /// -/// @param password The password for login in clear text (optional) -/// -/// @returns NSString* +/// @param password The password for login in clear text (optional) /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username/password supplied" +/// @return NSString* -(NSNumber*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler { @@ -460,8 +460,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Logs out current logged in user session /// -/// @returns void -/// +/// code:0 message:"successful operation" -(NSNumber*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; @@ -516,12 +515,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Updated user /// This can only be done by the logged in user. -/// @param username name that need to be deleted +/// @param username name that need to be deleted /// -/// @param body Updated user object (optional) -/// -/// @returns void +/// @param body Updated user object (optional) /// +/// code:400 message:"Invalid user supplied", +/// code:404 message:"User not found" -(NSNumber*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { @@ -590,5 +589,4 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; } - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h index b5500c2377b..719d193130b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -27,108 +27,84 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// /// @param body Pet object that needs to be added to the store (optional) -/// /// code:405 message:"Invalid input" -/// -(NSNumber*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; - /// Deletes a pet /// /// /// @param petId Pet id to delete /// @param apiKey (optional) -/// /// code:400 message:"Invalid pet value" -/// -(NSNumber*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler; - /// Finds Pets by status /// Multiple status values can be provided with comma separated strings /// /// @param status Status values that need to be considered for filter (optional) (default to available) -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid status value" -/// /// @return NSArray* -(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - /// Finds Pets by tags /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// @param tags Tags to filter by (optional) -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid tag value" -/// /// @return NSArray* -(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - /// Find pet by ID /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions /// /// @param petId ID of pet that needs to be fetched -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found" -/// /// @return SWGPet* -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; - /// Update an existing pet /// /// /// @param body Pet object that needs to be added to the store (optional) -/// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" -/// -(NSNumber*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; - /// Updates a pet in the store with form data /// /// /// @param petId ID of pet that needs to be updated /// @param name Updated name of the pet (optional) /// @param status Updated status of the pet (optional) -/// /// code:405 message:"Invalid input" -/// -(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler; - /// uploads an image /// /// /// @param petId ID of pet to update /// @param additionalMetadata Additional data to pass to server (optional) /// @param file file to upload (optional) -/// /// code:0 message:"successful operation" -/// -(NSNumber*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file completionHandler: (void (^)(NSError* error)) handler; - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index 16d1541471b..fb0421c81fd 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -72,10 +72,9 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Add a new pet to the store /// -/// @param body Pet object that needs to be added to the store (optional) -/// -/// @returns void +/// @param body Pet object that needs to be added to the store (optional) /// +/// code:405 message:"Invalid input" -(NSNumber*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -131,12 +130,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Deletes a pet /// -/// @param petId Pet id to delete +/// @param petId Pet id to delete /// -/// @param apiKey (optional) -/// -/// @returns void +/// @param apiKey (optional) /// +/// code:400 message:"Invalid pet value" -(NSNumber*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler { @@ -209,10 +207,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by status /// Multiple status values can be provided with comma separated strings -/// @param status Status values that need to be considered for filter (optional, default to available) -/// -/// @returns NSArray* +/// @param status Status values that need to be considered for filter (optional, default to available) /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid status value" +/// @return NSArray* -(NSNumber*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; @@ -271,10 +270,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by tags /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -/// @param tags Tags to filter by (optional) -/// -/// @returns NSArray* +/// @param tags Tags to filter by (optional) /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid tag value" +/// @return NSArray* -(NSNumber*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; @@ -333,10 +333,12 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Find pet by ID /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// @param petId ID of pet that needs to be fetched -/// -/// @returns SWGPet* +/// @param petId ID of pet that needs to be fetched /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found" +/// @return SWGPet* -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { // verify the required parameter 'petId' is set @@ -376,7 +378,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"petstore_auth", @"api_key"]; + NSArray *authSettings = @[@"api_key", @"petstore_auth"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; @@ -405,10 +407,11 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Update an existing pet /// -/// @param body Pet object that needs to be added to the store (optional) -/// -/// @returns void +/// @param body Pet object that needs to be added to the store (optional) /// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found", +/// code:405 message:"Validation exception" -(NSNumber*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -464,14 +467,13 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Updates a pet in the store with form data /// -/// @param petId ID of pet that needs to be updated +/// @param petId ID of pet that needs to be updated /// -/// @param name Updated name of the pet (optional) +/// @param name Updated name of the pet (optional) /// -/// @param status Updated status of the pet (optional) -/// -/// @returns void +/// @param status Updated status of the pet (optional) /// +/// code:405 message:"Invalid input" -(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status @@ -548,14 +550,13 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// uploads an image /// -/// @param petId ID of pet to update +/// @param petId ID of pet to update /// -/// @param additionalMetadata Additional data to pass to server (optional) +/// @param additionalMetadata Additional data to pass to server (optional) /// -/// @param file file to upload (optional) -/// -/// @returns void +/// @param file file to upload (optional) /// +/// code:0 message:"successful operation" -(NSNumber*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file @@ -628,5 +629,4 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; } - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h index 822701c3c41..3e101bed9a7 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -27,51 +27,39 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// @param orderId ID of the order that needs to be deleted -/// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Order not found" -/// -(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler; - /// Returns pet inventories by status /// Returns a map of status codes to quantities /// -/// /// code:200 message:"successful operation" -/// /// @return NSDictionary* -(NSNumber*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler; - /// Find purchase order by ID /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// @param orderId ID of pet that needs to be fetched -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid ID supplied", /// code:404 message:"Order not found" -/// /// @return SWGOrder* -(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; - /// Place an order for a pet /// /// /// @param body order placed for purchasing the pet (optional) -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" -/// /// @return SWGOrder* -(NSNumber*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m index e5964200f20..b86920b29e2 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -72,10 +72,10 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Delete purchase order by ID /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -/// @param orderId ID of the order that needs to be deleted -/// -/// @returns void +/// @param orderId ID of the order that needs to be deleted /// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" -(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'orderId' is set @@ -144,8 +144,8 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Returns pet inventories by status /// Returns a map of status codes to quantities -/// @returns NSDictionary* -/// +/// code:200 message:"successful operation" +/// @return NSDictionary* -(NSNumber*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; @@ -200,10 +200,12 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Find purchase order by ID /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -/// @param orderId ID of pet that needs to be fetched -/// -/// @returns SWGOrder* +/// @param orderId ID of pet that needs to be fetched /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// @return SWGOrder* -(NSNumber*) getOrderByIdWithOrderId: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { // verify the required parameter 'orderId' is set @@ -272,10 +274,11 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Place an order for a pet /// -/// @param body order placed for purchasing the pet (optional) -/// -/// @returns SWGOrder* +/// @param body order placed for purchasing the pet (optional) /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid Order" +/// @return SWGOrder* -(NSNumber*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -329,5 +332,4 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; } - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h index 630f6679a81..f0b5e37550b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -27,99 +27,75 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param body Created user object (optional) -/// /// code:0 message:"successful operation" -/// -(NSNumber*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; - /// Creates list of users with given input array /// /// /// @param body List of user object (optional) -/// /// code:0 message:"successful operation" -/// -(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; - /// Creates list of users with given input array /// /// /// @param body List of user object (optional) -/// /// code:0 message:"successful operation" -/// -(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; - /// Delete user /// This can only be done by the logged in user. /// /// @param username The name that needs to be deleted -/// /// code:400 message:"Invalid username supplied", /// code:404 message:"User not found" -/// -(NSNumber*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler; - /// Get user by user name /// /// /// @param username The name that needs to be fetched. Use user1 for testing. -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid username supplied", /// code:404 message:"User not found" -/// /// @return SWGUser* -(NSNumber*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; - /// Logs user into the system /// /// /// @param username The user name for login (optional) /// @param password The password for login in clear text (optional) -/// /// code:200 message:"successful operation", /// code:400 message:"Invalid username/password supplied" -/// /// @return NSString* -(NSNumber*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler; - /// Logs out current logged in user session /// /// -/// /// code:0 message:"successful operation" -/// -(NSNumber*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler; - /// Updated user /// This can only be done by the logged in user. /// /// @param username name that need to be deleted /// @param body Updated user object (optional) -/// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" -/// -(NSNumber*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; - @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m index 6ffb578ed76..df056030b75 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -72,10 +72,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Create user /// This can only be done by the logged in user. -/// @param body Created user object (optional) -/// -/// @returns void +/// @param body Created user object (optional) /// +/// code:0 message:"successful operation" -(NSNumber*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -131,10 +130,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) -/// -/// @returns void +/// @param body List of user object (optional) /// +/// code:0 message:"successful operation" -(NSNumber*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -190,10 +188,9 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) -/// -/// @returns void +/// @param body List of user object (optional) /// +/// code:0 message:"successful operation" -(NSNumber*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -249,10 +246,10 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Delete user /// This can only be done by the logged in user. -/// @param username The name that needs to be deleted -/// -/// @returns void +/// @param username The name that needs to be deleted /// +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" -(NSNumber*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set @@ -321,10 +318,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Get user by user name /// -/// @param username The name that needs to be fetched. Use user1 for testing. -/// -/// @returns SWGUser* +/// @param username The name that needs to be fetched. Use user1 for testing. /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// @return SWGUser* -(NSNumber*) getUserByNameWithUsername: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { // verify the required parameter 'username' is set @@ -393,12 +392,13 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Logs user into the system /// -/// @param username The user name for login (optional) +/// @param username The user name for login (optional) /// -/// @param password The password for login in clear text (optional) -/// -/// @returns NSString* +/// @param password The password for login in clear text (optional) /// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username/password supplied" +/// @return NSString* -(NSNumber*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler { @@ -460,8 +460,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Logs out current logged in user session /// -/// @returns void -/// +/// code:0 message:"successful operation" -(NSNumber*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; @@ -516,12 +515,12 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Updated user /// This can only be done by the logged in user. -/// @param username name that need to be deleted +/// @param username name that need to be deleted /// -/// @param body Updated user object (optional) -/// -/// @returns void +/// @param body Updated user object (optional) /// +/// code:400 message:"Invalid user supplied", +/// code:404 message:"User not found" -(NSNumber*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { @@ -590,5 +589,4 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; } - @end diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md index c4275413c62..9971ffff450 100644 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -246,14 +246,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond ```objc SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - // Configure API key authorization: (authentication scheme: api_key) [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + NSNumber* petId = @789; // ID of pet that needs to be fetched @@ -283,7 +283,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) +[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -447,7 +447,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **NSNumber***| ID of pet to update | **additionalMetadata** | **NSString***| Additional data to pass to server | [optional] - **file** | **NSURL*****NSURL***| file to upload | [optional] + **file** | **NSURL***| file to upload | [optional] ### Return type