From dce532e8c7d57008128c398bcec16f81cd88965e Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 24 Sep 2016 00:57:01 +0800 Subject: [PATCH] fix trailing comma in go api client --- .../src/main/resources/go/api.mustache | 4 ++-- .../petstore/go/go-petstore/fake_api.go | 12 +++++----- .../client/petstore/go/go-petstore/pet_api.go | 24 +++++++++---------- .../petstore/go/go-petstore/store_api.go | 8 +++---- .../petstore/go/go-petstore/user_api.go | 16 ++++++------- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index d832a36a5ef..ef388bcf278 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -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) @@ -108,7 +108,7 @@ func (a {{{classname}}}) {{{nickname}}}({{#allParams}}{{paramName}} {{{dataType} // to determine the Accept header localVarHttpHeaderAccepts := []string{ {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} + "{{{mediaType}}}", {{/produces}} } diff --git a/samples/client/petstore/go/go-petstore/fake_api.go b/samples/client/petstore/go/go-petstore/fake_api.go index b397726cee6..f7cb65af821 100644 --- a/samples/client/petstore/go/go-petstore/fake_api.go +++ b/samples/client/petstore/go/go-petstore/fake_api.go @@ -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) @@ -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 @@ -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) @@ -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 @@ -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) @@ -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 diff --git a/samples/client/petstore/go/go-petstore/pet_api.go b/samples/client/petstore/go/go-petstore/pet_api.go index 093a54342e4..bb89aea874d 100644 --- a/samples/client/petstore/go/go-petstore/pet_api.go +++ b/samples/client/petstore/go/go-petstore/pet_api.go @@ -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) @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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) @@ -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 @@ -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) @@ -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 @@ -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) @@ -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 diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index 97c82b5f91c..384fb351823 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/samples/client/petstore/go/go-petstore/user_api.go b/samples/client/petstore/go/go-petstore/user_api.go index 5229e079366..9ec01dd7b64 100644 --- a/samples/client/petstore/go/go-petstore/user_api.go +++ b/samples/client/petstore/go/go-petstore/user_api.go @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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