forked from loafle/openapi-generator-original
Go: Replace .Username with .UserName in generated API methods.
Right now, any generated code where the http basic authentication is required is broken, as it tries to access nonexistent field in the generated `Configuration` struct. The alternative is to fix `configuration.mustache` to replace the `UserName` field with `Username` field.
This commit is contained in:
@@ -63,7 +63,7 @@ func (a {{{classname}}}) {{{nickname}}}({{#allParams}}{{paramName}} {{{dataType}
|
||||
{{/isApiKey}}
|
||||
{{#isBasic}}
|
||||
// http basic authentication required
|
||||
if a.Configuration.Username != "" || a.Configuration.Password != ""{
|
||||
if a.Configuration.UserName != "" || a.Configuration.Password != ""{
|
||||
localVarHeaderParams["Authorization"] = "Basic " + a.Configuration.GetBasicAuthEncodedString()
|
||||
}
|
||||
{{/isBasic}}
|
||||
|
||||
Reference in New Issue
Block a user