bugfix: use the correct key when generating auth example in readme (#19492)

This commit is contained in:
Chris McEvoy 2024-09-02 08:38:57 +01:00 committed by GitHub
parent 4ed8c70a92
commit 5b96e85fd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -109,7 +109,7 @@ Class | Method | HTTP request | Description
- **API key parameter name**: {{{keyParamName}}}
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
Note, each API key must be added to a map of `map[string]APIKey` where the key is: {{keyParamName}} and passed in as the auth context for each request.
Note, each API key must be added to a map of `map[string]APIKey` where the key is: {{name}} and passed in as the auth context for each request.
Example
@ -118,7 +118,7 @@ auth := context.WithValue(
context.Background(),
{{packageName}}.ContextAPIKeys,
map[string]{{packageName}}.APIKey{
"{{keyParamName}}": {Key: "API_KEY_STRING"},
"{{name}}": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)

View File

@ -98,7 +98,7 @@ Authentication schemes defined for the API:
- **API key parameter name**: X-Api-Key
- **Location**: HTTP header
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.
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.
Example
@ -107,7 +107,7 @@ auth := context.WithValue(
context.Background(),
x_auth_id_alias.ContextAPIKeys,
map[string]x_auth_id_alias.APIKey{
"X-Api-Key": {Key: "API_KEY_STRING"},
"api_key": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
@ -119,7 +119,7 @@ r, err := client.Service.Operation(auth, args)
- **API key parameter name**: api_key
- **Location**: URL query string
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.
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.
Example
@ -128,7 +128,7 @@ auth := context.WithValue(
context.Background(),
x_auth_id_alias.ContextAPIKeys,
map[string]x_auth_id_alias.APIKey{
"api_key": {Key: "API_KEY_STRING"},
"api_key_query": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)