Skip to content

Commit 4deaad5

Browse files
authored
[Go] fix documentation of API authorization in README files (#15345)
align wording across generators
1 parent adfb963 commit 4deaad5

4 files changed

Lines changed: 5 additions & 15 deletions

File tree

modules/openapi-generator/src/main/resources/go/README.mustache

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ Class | Method | HTTP request | Description
9898

9999
## Documentation For Authorization
100100

101-
{{^authMethods}} Endpoints do not require authorization.
102-
{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
101+
{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
102+
{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
103103
{{#authMethods}}
104-
105104
### {{{name}}}
106105

107106
{{#isApiKey}}

samples/client/petstore/go/go-petstore/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Class | Method | HTTP request | Description
172172
## Documentation For Authorization
173173

174174

175-
175+
Authentication schemes defined for the API:
176176
### petstore_auth
177177

178178

@@ -202,7 +202,6 @@ auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
202202
r, err := client.Service.Operation(auth, args)
203203
```
204204

205-
206205
### api_key
207206

208207
- **Type**: API key
@@ -211,7 +210,6 @@ r, err := client.Service.Operation(auth, args)
211210

212211
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request.
213212

214-
215213
### api_key_query
216214

217215
- **Type**: API key
@@ -220,7 +218,6 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
220218

221219
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request.
222220

223-
224221
### http_basic_test
225222

226223
- **Type**: HTTP basic authentication

samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Class | Method | HTTP request | Description
9090
## Documentation For Authorization
9191

9292

93-
93+
Authentication schemes defined for the API:
9494
### api_key
9595

9696
- **Type**: API key
@@ -99,7 +99,6 @@ Class | Method | HTTP request | Description
9999

100100
Note, each API key must be added to a map of `map[string]APIKey` where the key is: X-Api-Key and passed in as the auth context for each request.
101101

102-
103102
### api_key_query
104103

105104
- **Type**: API key

samples/openapi3/client/petstore/go/go-petstore/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Class | Method | HTTP request | Description
192192
## Documentation For Authorization
193193

194194

195-
195+
Authentication schemes defined for the API:
196196
### petstore_auth
197197

198198

@@ -222,7 +222,6 @@ auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
222222
r, err := client.Service.Operation(auth, args)
223223
```
224224

225-
226225
### api_key
227226

228227
- **Type**: API key
@@ -231,7 +230,6 @@ r, err := client.Service.Operation(auth, args)
231230

232231
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request.
233232

234-
235233
### api_key_query
236234

237235
- **Type**: API key
@@ -240,7 +238,6 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
240238

241239
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request.
242240

243-
244241
### http_basic_test
245242

246243
- **Type**: HTTP basic authentication
@@ -255,7 +252,6 @@ auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAut
255252
r, err := client.Service.Operation(auth, args)
256253
```
257254

258-
259255
### bearer_test
260256

261257
- **Type**: HTTP Bearer token authentication
@@ -267,7 +263,6 @@ auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_T
267263
r, err := client.Service.Operation(auth, args)
268264
```
269265

270-
271266
### http_signature_test
272267

273268
- **Type**: HTTP signature authentication

0 commit comments

Comments
 (0)