forked from loafle/openapi-generator-original
[lua] fix use of isBasic condition (#15529)
This commit is contained in:
@@ -53,7 +53,7 @@ Example
|
||||
r, err := client.Service.Operation(auth, args)
|
||||
```
|
||||
{{/isApiKey}}
|
||||
{{#isBasic}}- **Type**: HTTP basic authentication
|
||||
{{#isBasicBasic}}- **Type**: HTTP basic authentication
|
||||
|
||||
Example
|
||||
```
|
||||
@@ -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}}}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user