Fix warning docs return type (#4429)

* Objective C: Fix compilation warnings

If returnType is not provided, set the @return as void

* Run the `./bin/objc-petstore.sh`

* OBJECTIVE C SDK: Remove the return line for methods that return nothing all together

* obj-c sdk: Updated petstore sample
This commit is contained in:
Greg Rashkevitch
2016-12-20 10:10:47 +02:00
committed by wing328
parent ff70105484
commit 36b97c22af
7 changed files with 9 additions and 21 deletions

View File

@@ -21,8 +21,8 @@ extern NSInteger k{{classname}}MissingParamErrorCode;
/// {{#allParams}}@param {{paramName}} {{description}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
/// {{/allParams}}{{#responses}}
/// code:{{{code}}} message:"{{{message}}}"{{#hasMore}},{{/hasMore}}{{/responses}}
///
/// @return {{{returnType}}}
///{{#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}}
{{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}{{/allParams}}
{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) handler;

View File

@@ -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

View File

@@ -30,7 +30,6 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
///
/// code:405 message:"Invalid input"
///
/// @return
-(NSNumber*) addPetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler;
@@ -43,7 +42,6 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
///
/// code:400 message:"Invalid pet value"
///
/// @return
-(NSNumber*) deletePetWithPetId: (NSNumber*) petId
apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error)) handler;
@@ -98,7 +96,6 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
/// code:404 message:"Pet not found",
/// code:405 message:"Validation exception"
///
/// @return
-(NSNumber*) updatePetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler;
@@ -112,7 +109,6 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
///
/// code:405 message:"Invalid input"
///
/// @return
-(NSNumber*) updatePetWithFormWithPetId: (NSString*) petId
name: (NSString*) name
status: (NSString*) status
@@ -128,7 +124,6 @@ extern NSInteger kSWGPetApiMissingParamErrorCode;
///
/// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) uploadFileWithPetId: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata
file: (NSURL*) file

View File

@@ -376,7 +376,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513;
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
// Authentication setting
NSArray *authSettings = @[@"api_key", @"petstore_auth"];
NSArray *authSettings = @[@"petstore_auth", @"api_key"];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];

View File

@@ -31,7 +31,6 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode;
/// code:400 message:"Invalid ID supplied",
/// code:404 message:"Order not found"
///
/// @return
-(NSNumber*) deleteOrderWithOrderId: (NSString*) orderId
completionHandler: (void (^)(NSError* error)) handler;

View File

@@ -30,7 +30,6 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
///
/// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) createUserWithBody: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler;
@@ -42,7 +41,6 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
///
/// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler;
@@ -54,7 +52,6 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
///
/// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler;
@@ -67,7 +64,6 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
/// code:400 message:"Invalid username supplied",
/// code:404 message:"User not found"
///
/// @return
-(NSNumber*) deleteUserWithUsername: (NSString*) username
completionHandler: (void (^)(NSError* error)) handler;
@@ -107,7 +103,6 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
///
/// code:0 message:"successful operation"
///
/// @return
-(NSNumber*) logoutUserWithCompletionHandler:
(void (^)(NSError* error)) handler;
@@ -121,7 +116,6 @@ extern NSInteger kSWGUserApiMissingParamErrorCode;
/// 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;

View File

@@ -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
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
### 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***| file to upload | [optional]
**file** | **NSURL*****NSURL***| file to upload | [optional]
### Return type