Skip to content

Commit

Permalink
[lua] fix use of isBasic condition (#15529)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffmaelite committed May 20, 2023
1 parent f0d439f commit 7443c95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Example
r, err := client.Service.Operation(auth, args)
```
{{/isApiKey}}
{{#isBasic}}- **Type**: HTTP basic authentication
{{#isBasicBasic}}- **Type**: HTTP basic authentication

Example
```
Expand All @@ -63,7 +63,11 @@ Example
})
r, err := client.Service.Operation(auth, args)
```
{{/isBasic}}
{{/isBasicBasic}}
{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
{{/isBasicBearer}}
{{#isHttpSignature}}- **Type**: HTTP signature authentication
{{/isHttpSignature}}
{{#isOAuth}}- **Type**: OAuth
- **Flow**: {{{flow}}}
- **Authorization URL**: {{{authorizationUrl}}}
Expand Down
4 changes: 2 additions & 2 deletions modules/openapi-generator/src/main/resources/lua/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ function {{classname}}:{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{
-- TODO: api key in query '{{keyParamName}}'
{{/isKeyInQuery}}
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}
-- HTTP basic auth
req.readers:upsert("authorization", "Basic " .. basexx.to_base64(self.http_username .. " " .. self.http_password))
{{/isBasic}}
{{/isBasicBasic}}
{{#isOAuth}}
-- oAuth
if self.access_token then
Expand Down

0 comments on commit 7443c95

Please sign in to comment.