Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -18,6 +18,7 @@ type Configuration struct {
Scheme string `json:"scheme,omitempty"`
AccessToken string `json:"accessToken,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
}

func NewConfiguration() *Configuration {
Expand All @@ -27,7 +28,8 @@ func NewConfiguration() *Configuration {
Debug: false,
DefaultHeader: make(map[string]string),
ApiKey: make(map[string]string),
ApiKeyPrefix: make(map[string]string) ,
ApiKeyPrefix: make(map[string]string),
UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{version}}}/go{{/httpUserAgent}}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guohuang I think {{version}} (the API spec version) should be replaced by {{packageVersion}} (SDK version)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is inconsistent, in php, it uses {artifactVersion}}, anyway, the code has been updated, it worked.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, different languages have different CLI name for option. For perl, it's moduleVersion. For Ruby, it's gemVersion.

I did it that way because Perl developers would have no idea what artifactVersion is and moduleVersion should be more familiar to them, and similarly for other languages.

}
}

Expand Down
4 changes: 3 additions & 1 deletion samples/client/petstore/go/swagger/Configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Configuration struct {
Scheme string `json:"scheme,omitempty"`
AccessToken string `json:"accessToken,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
}

func NewConfiguration() *Configuration {
Expand All @@ -27,7 +28,8 @@ func NewConfiguration() *Configuration {
Debug: false,
DefaultHeader: make(map[string]string),
ApiKey: make(map[string]string),
ApiKeyPrefix: make(map[string]string) ,
ApiKeyPrefix: make(map[string]string),
UserAgent: "Swagger-Codegen/1.0.0/go",
}
}

Expand Down