Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions modules/swagger-codegen/src/main/resources/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (a {{{classname}}}) {{{nickname}}}({{#allParams}}{{paramName}} {{{dataType}
{{/hasQueryParams}}

// to determine the Content-Type header
localVarHttpContentTypes := []string{ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }
localVarHttpContentTypes := []string{ {{#consumes}}"{{{mediaType}}}", {{/consumes}} }

// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
Expand All @@ -108,7 +108,7 @@ func (a {{{classname}}}) {{{nickname}}}({{#allParams}}{{paramName}} {{{dataType}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
{{#produces}}
"{{{mediaType}}}"{{^-last}},{{/-last}}
"{{{mediaType}}}",
{{/produces}}
}

Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/go/go-petstore/fake_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (a FakeApi) TestClientModel(body Client) (*Client, *APIResponse, error) {
}

// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json" }
localVarHttpContentTypes := []string{ "application/json", }

// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
Expand All @@ -82,7 +82,7 @@ func (a FakeApi) TestClientModel(body Client) (*Client, *APIResponse, error) {
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -152,7 +152,7 @@ func (a FakeApi) TestEndpointParameters(number float32, double float64, patternW
}

// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/xml; charset=utf-8", "application/json; charset=utf-8" }
localVarHttpContentTypes := []string{ "application/xml; charset=utf-8", "application/json; charset=utf-8", }

// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
Expand All @@ -162,7 +162,7 @@ func (a FakeApi) TestEndpointParameters(number float32, double float64, patternW
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml; charset=utf-8",
"application/json; charset=utf-8"
"application/json; charset=utf-8",
}

// set Accept header
Expand Down Expand Up @@ -240,7 +240,7 @@ func (a FakeApi) TestEnumParameters(enumFormStringArray []string, enumFormString
localVarQueryParams.Add("enum_query_integer", a.Configuration.APIClient.ParameterToString(enumQueryInteger, ""))

// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json" }
localVarHttpContentTypes := []string{ "application/json", }

// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
Expand All @@ -249,7 +249,7 @@ func (a FakeApi) TestEnumParameters(enumFormStringArray []string, enumFormString
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json"
"application/json",
}

// set Accept header
Expand Down
24 changes: 12 additions & 12 deletions samples/client/petstore/go/go-petstore/pet_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (a PetApi) AddPet(body Pet) (*APIResponse, error) {
}

// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/xml" }
localVarHttpContentTypes := []string{ "application/json", "application/xml", }

// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
Expand All @@ -91,7 +91,7 @@ func (a PetApi) AddPet(body Pet) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -159,7 +159,7 @@ func (a PetApi) DeletePet(petId int64, apiKey string) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -233,7 +233,7 @@ func (a PetApi) FindPetsByStatus(status []string) ([]Pet, *APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -307,7 +307,7 @@ func (a PetApi) FindPetsByTags(tags []string) ([]Pet, *APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -372,7 +372,7 @@ func (a PetApi) GetPetById(petId int64) (*Pet, *APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -428,7 +428,7 @@ func (a PetApi) UpdatePet(body Pet) (*APIResponse, error) {
}

// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/xml" }
localVarHttpContentTypes := []string{ "application/json", "application/xml", }

// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
Expand All @@ -438,7 +438,7 @@ func (a PetApi) UpdatePet(body Pet) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -497,7 +497,7 @@ func (a PetApi) UpdatePetWithForm(petId int64, name string, status string) (*API
}

// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded" }
localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", }

// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
Expand All @@ -507,7 +507,7 @@ func (a PetApi) UpdatePetWithForm(petId int64, name string, status string) (*API
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -566,7 +566,7 @@ func (a PetApi) UploadFile(petId int64, additionalMetadata string, file *os.File
}

// to determine the Content-Type header
localVarHttpContentTypes := []string{ "multipart/form-data" }
localVarHttpContentTypes := []string{ "multipart/form-data", }

// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
Expand All @@ -575,7 +575,7 @@ func (a PetApi) UploadFile(petId int64, additionalMetadata string, file *os.File
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json"
"application/json",
}

// set Accept header
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/go/go-petstore/store_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (a StoreApi) DeleteOrder(orderId string) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -145,7 +145,7 @@ func (a StoreApi) GetInventory() (*map[string]int32, *APIResponse, error) {
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -207,7 +207,7 @@ func (a StoreApi) GetOrderById(orderId int64) (*Order, *APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -268,7 +268,7 @@ func (a StoreApi) PlaceOrder(body Order) (*Order, *APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down
16 changes: 8 additions & 8 deletions samples/client/petstore/go/go-petstore/user_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (a UserApi) CreateUser(body User) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -145,7 +145,7 @@ func (a UserApi) CreateUsersWithArrayInput(body []User) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -206,7 +206,7 @@ func (a UserApi) CreateUsersWithListInput(body []User) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -268,7 +268,7 @@ func (a UserApi) DeleteUser(username string) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -328,7 +328,7 @@ func (a UserApi) GetUserByName(username string) (*User, *APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -392,7 +392,7 @@ func (a UserApi) LoginUser(username string, password string) (*string, *APIRespo
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -452,7 +452,7 @@ func (a UserApi) LogoutUser() (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down Expand Up @@ -513,7 +513,7 @@ func (a UserApi) UpdateUser(username string, body User) (*APIResponse, error) {
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json"
"application/json",
}

// set Accept header
Expand Down