File tree Expand file tree Collapse file tree 5 files changed +23
-23
lines changed
modules/swagger-codegen/src/main/resources/objc
samples/client/petstore/objc/default Expand file tree Collapse file tree 5 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,10 @@ Please follow the [installation procedure](#installation--usage) and then run th
84
84
85
85
{ {classname} } *apiInstance = [[{ {classname} } alloc] init];
86
86
87
- { {#summary} } // { {{.} }}
87
+ { {#summary} }// { {{.} }}
88
88
{ {/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} }
89
89
{ {paramName} }{ {/secondaryParam} }:{ {paramName} }{ {/allParams} }
90
- { {#hasParams} }completionHandler: { {/hasParams} }^({ {#returnBaseType} }{ {{returnType} }} output, { {/returnBaseType} }NSError* error)) {
90
+ { {#hasParams} }completionHandler: { {/hasParams} }^({ {#returnBaseType} }{ {{returnType} }} output, { {/returnBaseType} }NSError* error) {
91
91
{{#returnType} }
92
92
if (output) {
93
93
NSLog(@" %@" , output);
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi
6
6
7
7
- API version: 1.0.0
8
8
- Package version:
9
- - Build date: 2016-06-16T11:33:30.448+02 :00
9
+ - Build date: 2016-07-03T21:49:00.509+08 :00
10
10
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen
11
11
12
12
## Requirements
@@ -74,9 +74,9 @@ SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to t
74
74
75
75
SWGPetApi * apiInstance = [[ SWGPetApi alloc] init] ;
76
76
77
- // Add a new pet to the store
77
+ // Add a new pet to the store
78
78
[ apiInstance addPetWithBody: body
79
- completionHandler: ^(NSError* error)) {
79
+ completionHandler: ^(NSError* error) {
80
80
if (error) {
81
81
NSLog(@"Error: %@", error);
82
82
}
@@ -124,6 +124,12 @@ Class | Method | HTTP request | Description
124
124
## Documentation For Authorization
125
125
126
126
127
+ ## api_key
128
+
129
+ - **Type**: API key
130
+ - **API key parameter name**: api_key
131
+ - **Location**: HTTP header
132
+
127
133
## petstore_auth
128
134
129
135
- **Type**: OAuth
@@ -133,12 +139,6 @@ Class | Method | HTTP request | Description
133
139
- **write:pets**: modify pets in your account
134
140
- **read:pets**: read your pets
135
141
136
- ## api_key
137
-
138
- - **Type**: API key
139
- - **API key parameter name**: api_key
140
- - **Location**: HTTP header
141
-
142
142
143
143
## Author
144
144
Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId
376
376
NSString *requestContentType = [self .apiClient.sanitizer selectHeaderContentType: @[]];
377
377
378
378
// Authentication setting
379
- NSArray *authSettings = @[@" petstore_auth " , @" api_key " ];
379
+ NSArray *authSettings = @[@" api_key " , @" petstore_auth " ];
380
380
381
381
id bodyParam = nil ;
382
382
NSMutableDictionary *formParams = [[NSMutableDictionary alloc ] init ];
Original file line number Diff line number Diff line change @@ -110,20 +110,20 @@ - (NSDictionary *) apiKeyPrefix {
110
110
111
111
- (NSDictionary *) authSettings {
112
112
return @{
113
- @" petstore_auth" :
114
- @{
115
- @" type" : @" oauth" ,
116
- @" in" : @" header" ,
117
- @" key" : @" Authorization" ,
118
- @" value" : [self getAccessToken ]
119
- },
120
113
@" api_key" :
121
114
@{
122
115
@" type" : @" api_key" ,
123
116
@" in" : @" header" ,
124
117
@" key" : @" api_key" ,
125
118
@" value" : [self getApiKeyWithPrefix: @" api_key" ]
126
119
},
120
+ @" petstore_auth" :
121
+ @{
122
+ @" type" : @" oauth" ,
123
+ @" in" : @" header" ,
124
+ @" key" : @" Authorization" ,
125
+ @" value" : [self getAccessToken ]
126
+ },
127
127
};
128
128
}
129
129
Original file line number Diff line number Diff line change @@ -246,14 +246,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
246
246
``` objc
247
247
SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig ];
248
248
249
- // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
250
- [apiConfig setAccessToken: @"YOUR_ACCESS_TOKEN"] ;
251
-
252
249
// Configure API key authorization: (authentication scheme: api_key)
253
250
[apiConfig setApiKey: @"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"] ;
254
251
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
255
252
//[ apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"] ;
256
253
254
+ // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
255
+ [ apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"] ;
256
+
257
257
258
258
NSNumber* petId = @789 ; // ID of pet that needs to be fetched
259
259
@@ -283,7 +283,7 @@ Name | Type | Description | Notes
283
283
284
284
### Authorization
285
285
286
- [petstore_auth ](../README.md#petstore_auth ), [api_key ](../README.md#api_key )
286
+ [api_key ](../README.md#api_key ), [petstore_auth ](../README.md#petstore_auth )
287
287
288
288
### HTTP request headers
289
289
You can’t perform that action at this time.
0 commit comments