Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lua] fix use of isBasic condition #15529

Merged
merged 1 commit into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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