mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
issue #1946, added AddDefaultHeader method for GO
This commit is contained in:
parent
4942ebdc73
commit
00fcf9946a
@ -14,12 +14,19 @@ type Configuration struct {
|
||||
BasePath string `json:"basePath,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||
}
|
||||
|
||||
func NewConfiguration() *Configuration {
|
||||
defaultHeader := make(map[string]string)
|
||||
return &Configuration{
|
||||
BasePath: "{{basePath}}",
|
||||
UserName: "",
|
||||
Debug: false,
|
||||
DefaultHeader: defaultHeader,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
c.DefaultHeader[key] = value
|
||||
}
|
@ -14,12 +14,19 @@ type Configuration struct {
|
||||
BasePath string `json:"basePath,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||
}
|
||||
|
||||
func NewConfiguration() *Configuration {
|
||||
defaultHeader := make(map[string]string)
|
||||
return &Configuration{
|
||||
BasePath: "http://petstore.swagger.io/v2",
|
||||
UserName: "",
|
||||
Debug: false,
|
||||
DefaultHeader: defaultHeader,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
c.DefaultHeader[key] = value
|
||||
}
|
Loading…
Reference in New Issue
Block a user