Skip to content

Commit 3f6f4bf

Browse files
committed
fix objc readme doc
1 parent 82ee6bb commit 3f6f4bf

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

modules/swagger-codegen/src/main/resources/objc/README.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ Please follow the [installation procedure](#installation--usage) and then run th
8484

8585
{{classname}} *apiInstance = [[{{classname}} alloc] init];
8686

87-
{{#summary}} // {{{.}}}
87+
{{#summary}}// {{{.}}}
8888
{{/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}}
8989
{{paramName}}{{/secondaryParam}}:{{paramName}}{{/allParams}}
90-
{{#hasParams}}completionHandler: {{/hasParams}}^({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error)) {
90+
{{#hasParams}}completionHandler: {{/hasParams}}^({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error) {
9191
{{#returnType}}
9292
if (output) {
9393
NSLog(@"%@", output);

samples/client/petstore/objc/default/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi
66

77
- API version: 1.0.0
88
- Package version:
9-
- Build date: 2016-06-16T11:33:30.448+02:00
9+
- Build date: 2016-07-03T21:49:00.509+08:00
1010
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen
1111

1212
## Requirements
@@ -74,9 +74,9 @@ SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to t
7474

7575
SWGPetApi *apiInstance = [[SWGPetApi alloc] init];
7676

77-
// Add a new pet to the store
77+
// Add a new pet to the store
7878
[apiInstance addPetWithBody:body
79-
completionHandler: ^(NSError* error)) {
79+
completionHandler: ^(NSError* error) {
8080
if (error) {
8181
NSLog(@"Error: %@", error);
8282
}
@@ -124,6 +124,12 @@ Class | Method | HTTP request | Description
124124
## Documentation For Authorization
125125
126126
127+
## api_key
128+
129+
- **Type**: API key
130+
- **API key parameter name**: api_key
131+
- **Location**: HTTP header
132+
127133
## petstore_auth
128134
129135
- **Type**: OAuth
@@ -133,12 +139,6 @@ Class | Method | HTTP request | Description
133139
- **write:pets**: modify pets in your account
134140
- **read:pets**: read your pets
135141
136-
## api_key
137-
138-
- **Type**: API key
139-
- **API key parameter name**: api_key
140-
- **Location**: HTTP header
141-
142142
143143
## Author
144144

samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ -(NSNumber*) getPetByIdWithPetId: (NSNumber*) petId
376376
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];
377377

378378
// Authentication setting
379-
NSArray *authSettings = @[@"petstore_auth", @"api_key"];
379+
NSArray *authSettings = @[@"api_key", @"petstore_auth"];
380380

381381
id bodyParam = nil;
382382
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];

samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,20 @@ - (NSDictionary *) apiKeyPrefix {
110110

111111
- (NSDictionary *) authSettings {
112112
return @{
113-
@"petstore_auth":
114-
@{
115-
@"type": @"oauth",
116-
@"in": @"header",
117-
@"key": @"Authorization",
118-
@"value": [self getAccessToken]
119-
},
120113
@"api_key":
121114
@{
122115
@"type": @"api_key",
123116
@"in": @"header",
124117
@"key": @"api_key",
125118
@"value": [self getApiKeyWithPrefix:@"api_key"]
126119
},
120+
@"petstore_auth":
121+
@{
122+
@"type": @"oauth",
123+
@"in": @"header",
124+
@"key": @"Authorization",
125+
@"value": [self getAccessToken]
126+
},
127127
};
128128
}
129129

samples/client/petstore/objc/default/docs/SWGPetApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
246246
```objc
247247
SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig];
248248

249-
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
250-
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
251-
252249
// Configure API key authorization: (authentication scheme: api_key)
253250
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
254251
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
255252
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
256253

254+
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
255+
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
256+
257257

258258
NSNumber* petId = @789; // ID of pet that needs to be fetched
259259

@@ -283,7 +283,7 @@ Name | Type | Description | Notes
283283
284284
### Authorization
285285
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)
287287
288288
### HTTP request headers
289289

0 commit comments

Comments
 (0)