forked from loafle/openapi-generator-original
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"`
|
BasePath string `json:"basePath,omitempty"`
|
||||||
Host string `json:"host,omitempty"`
|
Host string `json:"host,omitempty"`
|
||||||
Scheme string `json:"scheme,omitempty"`
|
Scheme string `json:"scheme,omitempty"`
|
||||||
|
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConfiguration() *Configuration {
|
func NewConfiguration() *Configuration {
|
||||||
|
defaultHeader := make(map[string]string)
|
||||||
return &Configuration{
|
return &Configuration{
|
||||||
BasePath: "{{basePath}}",
|
BasePath: "{{basePath}}",
|
||||||
UserName: "",
|
UserName: "",
|
||||||
Debug: false,
|
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"`
|
BasePath string `json:"basePath,omitempty"`
|
||||||
Host string `json:"host,omitempty"`
|
Host string `json:"host,omitempty"`
|
||||||
Scheme string `json:"scheme,omitempty"`
|
Scheme string `json:"scheme,omitempty"`
|
||||||
|
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConfiguration() *Configuration {
|
func NewConfiguration() *Configuration {
|
||||||
|
defaultHeader := make(map[string]string)
|
||||||
return &Configuration{
|
return &Configuration{
|
||||||
BasePath: "http://petstore.swagger.io/v2",
|
BasePath: "http://petstore.swagger.io/v2",
|
||||||
UserName: "",
|
UserName: "",
|
||||||
Debug: false,
|
Debug: false,
|
||||||
|
DefaultHeader: defaultHeader,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||||
|
c.DefaultHeader[key] = value
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user