mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
[Objc] Remove try catch form documentation.
This commit is contained in:
parent
5c8516ce24
commit
db27498961
@ -42,6 +42,7 @@ pod '{{podName}}', :path => 'Vendor/{{podName}}'
|
||||
### Usage
|
||||
|
||||
Import the following:
|
||||
|
||||
```objc
|
||||
#import <{{podName}}/{{{classPrefix}}}ApiClient.h>
|
||||
#import <{{podName}}/{{{classPrefix}}}Configuration.h>
|
||||
@ -81,12 +82,10 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
||||
{{#allParams}}{{{dataType}}} *{{paramName}} = {{{example}}}; // {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||
{{/allParams}}
|
||||
|
||||
@try
|
||||
{
|
||||
{{classname}} *apiInstance = [[{{classname}} alloc] init];
|
||||
{{classname}} *apiInstance = [[{{classname}} alloc] init];
|
||||
|
||||
{{#summary}} // {{{.}}}
|
||||
{{/summary}} [apiInstance {{#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}}
|
||||
{{/summary}}[apiInstance {{#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}}:{{paramName}}{{/allParams}}
|
||||
{{#hasParams}}completionHandler: {{/hasParams}}^({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) {
|
||||
{{#returnType}}
|
||||
@ -98,12 +97,6 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
||||
NSLog(@"Error: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling {{classname}}->{{operationId}}: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
|
||||
```
|
||||
|
||||
|
@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version:
|
||||
- Build date: 2016-05-16T07:20:55.501+02:00
|
||||
- Build date: 2016-05-16T07:44:16.324+02:00
|
||||
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen
|
||||
|
||||
## Requirements
|
||||
@ -37,6 +37,7 @@ pod 'SwaggerClient', :path => 'Vendor/SwaggerClient'
|
||||
### Usage
|
||||
|
||||
Import the following:
|
||||
|
||||
```objc
|
||||
#import <SwaggerClient/SWGApiClient.h>
|
||||
#import <SwaggerClient/SWGConfiguration.h>
|
||||
@ -71,23 +72,15 @@ SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
|
||||
|
||||
SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional)
|
||||
|
||||
@try
|
||||
{
|
||||
SWGPetApi *apiInstance = [[SWGPetApi alloc] init];
|
||||
SWGPetApi *apiInstance = [[SWGPetApi alloc] init];
|
||||
|
||||
// Add a new pet to the store
|
||||
[apiInstance addPetWithBody:body
|
||||
[apiInstance addPetWithBody:body
|
||||
completionHandler: ^(NSError* error)) {
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"Exception when calling SWGPetApi->addPet: %@ ", exception.name);
|
||||
NSLog(@"Reason: %@ ", exception.reason);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user