From b159904367a29df2b12b836d7cd656c9d0a40d11 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 16 Oct 2017 10:47:41 +0800 Subject: [PATCH] revise go header, minor formatting fix --- .../src/main/resources/go/api.mustache | 30 ++-- .../main/resources/go/partial_header.mustache | 10 +- .../additional_properties_class.go | 4 +- .../client/petstore/go/go-petstore/animal.go | 4 +- .../petstore/go/go-petstore/animal_farm.go | 4 +- .../go/go-petstore/another_fake_api.go | 22 +-- .../petstore/go/go-petstore/api_client.go | 4 +- .../petstore/go/go-petstore/api_response.go | 4 +- .../array_of_array_of_number_only.go | 4 +- .../go/go-petstore/array_of_number_only.go | 4 +- .../petstore/go/go-petstore/array_test.go | 4 +- .../petstore/go/go-petstore/capitalization.go | 4 +- samples/client/petstore/go/go-petstore/cat.go | 4 +- .../petstore/go/go-petstore/category.go | 4 +- .../petstore/go/go-petstore/class_model.go | 4 +- .../client/petstore/go/go-petstore/client.go | 4 +- .../petstore/go/go-petstore/configuration.go | 4 +- samples/client/petstore/go/go-petstore/dog.go | 4 +- .../petstore/go/go-petstore/enum_arrays.go | 4 +- .../petstore/go/go-petstore/enum_class.go | 4 +- .../petstore/go/go-petstore/enum_test.go | 4 +- .../petstore/go/go-petstore/fake_api.go | 144 +++++++++--------- .../go-petstore/fake_classname_tags123_api.go | 22 +-- .../petstore/go/go-petstore/format_test.go | 4 +- .../go/go-petstore/has_only_read_only.go | 4 +- .../client/petstore/go/go-petstore/list.go | 4 +- .../petstore/go/go-petstore/map_test.go | 4 +- ...perties_and_additional_properties_class.go | 4 +- .../go/go-petstore/model_200_response.go | 4 +- .../go/go-petstore/model_api_response.go | 4 +- .../petstore/go/go-petstore/model_return.go | 4 +- .../client/petstore/go/go-petstore/name.go | 4 +- .../petstore/go/go-petstore/number_only.go | 4 +- .../client/petstore/go/go-petstore/order.go | 4 +- .../petstore/go/go-petstore/outer_boolean.go | 4 +- .../go/go-petstore/outer_composite.go | 4 +- .../petstore/go/go-petstore/outer_enum.go | 4 +- .../petstore/go/go-petstore/outer_number.go | 4 +- .../petstore/go/go-petstore/outer_string.go | 4 +- samples/client/petstore/go/go-petstore/pet.go | 4 +- .../client/petstore/go/go-petstore/pet_api.go | 132 ++++++++-------- .../go/go-petstore/read_only_first.go | 4 +- .../go/go-petstore/special_model_name.go | 4 +- .../petstore/go/go-petstore/store_api.go | 76 ++++----- samples/client/petstore/go/go-petstore/tag.go | 4 +- .../client/petstore/go/go-petstore/user.go | 4 +- .../petstore/go/go-petstore/user_api.go | 124 +++++++-------- 47 files changed, 360 insertions(+), 356 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index 57c07808b4e..d061aef0cf6 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -57,22 +57,22 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C {{#required}} {{#minItems}} if len({{paramName}}) < {{minItems}} { - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") } {{/minItems}} {{#maxItems}} if len({{paramName}}) > {{maxItems}} { - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") } {{/maxItems}} {{#minLength}} if strlen({{paramName}}) < {{minLength}} { - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") } {{/minLength}} {{#maxLength}} if strlen({{paramName}}) > {{maxLength}} { - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") } {{/maxLength}} {{#minimum}} @@ -83,7 +83,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C {{^isString}} if {{paramName}} < {{minimum}} { {{/isString}} - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") } {{/minimum}} {{#maximum}} @@ -94,7 +94,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C {{^isString}} if {{paramName}} > {{maximum}} { {{/isString}} - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") } {{/maximum}} {{/required}} @@ -206,18 +206,18 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C return {{#returnType}}successPayload, {{/returnType}}nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } {{#returnType}} - + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err + return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err } {{/returnType}} diff --git a/modules/swagger-codegen/src/main/resources/go/partial_header.mustache b/modules/swagger-codegen/src/main/resources/go/partial_header.mustache index 83edccca9b2..d24dfec369d 100644 --- a/modules/swagger-codegen/src/main/resources/go/partial_header.mustache +++ b/modules/swagger-codegen/src/main/resources/go/partial_header.mustache @@ -7,7 +7,11 @@ * {{{appDescription}}} * {{/appDescription}} - * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} - * Generated by: https://github.com/swagger-api/swagger-codegen.git + {{#version}} + * API version: {{{version}}} + {{/version}} + {{#infoEmail}} + * Contact: {{{infoEmail}}} + {{/infoEmail}} + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ diff --git a/samples/client/petstore/go/go-petstore/additional_properties_class.go b/samples/client/petstore/go/go-petstore/additional_properties_class.go index 638857fb25f..ff018d60e14 100644 --- a/samples/client/petstore/go/go-petstore/additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/additional_properties_class.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/animal.go b/samples/client/petstore/go/go-petstore/animal.go index 40b5778704b..4ae6c33a58a 100644 --- a/samples/client/petstore/go/go-petstore/animal.go +++ b/samples/client/petstore/go/go-petstore/animal.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/animal_farm.go b/samples/client/petstore/go/go-petstore/animal_farm.go index 6b872ea1c42..5314c78829c 100644 --- a/samples/client/petstore/go/go-petstore/animal_farm.go +++ b/samples/client/petstore/go/go-petstore/animal_farm.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/another_fake_api.go b/samples/client/petstore/go/go-petstore/another_fake_api.go index 5eb37c217fc..5dc5f833707 100644 --- a/samples/client/petstore/go/go-petstore/another_fake_api.go +++ b/samples/client/petstore/go/go-petstore/another_fake_api.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -74,17 +74,17 @@ func (a *AnotherFakeApiService) TestSpecialTags(body Client) (Client, *http.Res return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } diff --git a/samples/client/petstore/go/go-petstore/api_client.go b/samples/client/petstore/go/go-petstore/api_client.go index 798424db7e6..cb3c1683c53 100644 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ b/samples/client/petstore/go/go-petstore/api_client.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/api_response.go b/samples/client/petstore/go/go-petstore/api_response.go index 03c6528380b..2e6e99e3e72 100644 --- a/samples/client/petstore/go/go-petstore/api_response.go +++ b/samples/client/petstore/go/go-petstore/api_response.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go index c268522aa9c..2ea01100c1b 100644 --- a/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/array_of_number_only.go b/samples/client/petstore/go/go-petstore/array_of_number_only.go index f04e5a2be6f..af7ceb14160 100644 --- a/samples/client/petstore/go/go-petstore/array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/array_of_number_only.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/array_test.go b/samples/client/petstore/go/go-petstore/array_test.go index bbb667e88b0..1b7a9a8a170 100644 --- a/samples/client/petstore/go/go-petstore/array_test.go +++ b/samples/client/petstore/go/go-petstore/array_test.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/capitalization.go b/samples/client/petstore/go/go-petstore/capitalization.go index 7e3f1910179..399f39b12b2 100644 --- a/samples/client/petstore/go/go-petstore/capitalization.go +++ b/samples/client/petstore/go/go-petstore/capitalization.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/cat.go b/samples/client/petstore/go/go-petstore/cat.go index a9192b03c7c..ac2e7e72db7 100644 --- a/samples/client/petstore/go/go-petstore/cat.go +++ b/samples/client/petstore/go/go-petstore/cat.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/category.go b/samples/client/petstore/go/go-petstore/category.go index 5dace4961ff..20d3921d22c 100644 --- a/samples/client/petstore/go/go-petstore/category.go +++ b/samples/client/petstore/go/go-petstore/category.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/class_model.go b/samples/client/petstore/go/go-petstore/class_model.go index 2a01b0265ab..7982d3482c0 100644 --- a/samples/client/petstore/go/go-petstore/class_model.go +++ b/samples/client/petstore/go/go-petstore/class_model.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index e9331f3cd42..1053b95cecd 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index cd828fc90ca..2d1fb5427b4 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/dog.go b/samples/client/petstore/go/go-petstore/dog.go index 700c407d484..ae45406c754 100644 --- a/samples/client/petstore/go/go-petstore/dog.go +++ b/samples/client/petstore/go/go-petstore/dog.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/enum_arrays.go b/samples/client/petstore/go/go-petstore/enum_arrays.go index 7dcf60043d3..0ff0813a1d2 100644 --- a/samples/client/petstore/go/go-petstore/enum_arrays.go +++ b/samples/client/petstore/go/go-petstore/enum_arrays.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/enum_class.go b/samples/client/petstore/go/go-petstore/enum_class.go index f96897cbd0a..4950a03e747 100644 --- a/samples/client/petstore/go/go-petstore/enum_class.go +++ b/samples/client/petstore/go/go-petstore/enum_class.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/enum_test.go b/samples/client/petstore/go/go-petstore/enum_test.go index bd547952198..58e4ea6a746 100644 --- a/samples/client/petstore/go/go-petstore/enum_test.go +++ b/samples/client/petstore/go/go-petstore/enum_test.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/fake_api.go b/samples/client/petstore/go/go-petstore/fake_api.go index 8dbceb67737..fff05137487 100644 --- a/samples/client/petstore/go/go-petstore/fake_api.go +++ b/samples/client/petstore/go/go-petstore/fake_api.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -77,17 +77,17 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(localVarOptionals map[string] return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -144,17 +144,17 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(localVarOptionals map[strin return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -211,17 +211,17 @@ func (a *FakeApiService) FakeOuterNumberSerialize(localVarOptionals map[string]i return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -278,17 +278,17 @@ func (a *FakeApiService) FakeOuterStringSerialize(localVarOptionals map[string]i return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -343,17 +343,17 @@ func (a *FakeApiService) TestClientModel(body Client) (Client, *http.Response, return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -395,16 +395,16 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarFormParams := url.Values{} if number < 32.1 { - return nil, reportError("number must be greater than 32.1") + return nil, reportError("number must be greater than 32.1") } if number > 543.2 { - return nil, reportError("number must be less than 543.2") + return nil, reportError("number must be less than 543.2") } if double < 67.8 { - return nil, reportError("double must be greater than 67.8") + return nil, reportError("double must be greater than 67.8") } if double > 123.4 { - return nil, reportError("double must be less than 123.4") + return nil, reportError("double must be less than 123.4") } if err := typeCheckParameter(localVarOptionals["integer"], "int32", "integer"); err != nil { return nil, err @@ -496,14 +496,14 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -600,14 +600,14 @@ func (a *FakeApiService) TestEnumParameters(localVarOptionals map[string]interfa return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -659,14 +659,14 @@ func (a *FakeApiService) TestJsonFormData(param string, param2 string) ( *http.R return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } diff --git a/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go b/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go index e159a49d4ac..d306797bfa0 100644 --- a/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go +++ b/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -85,17 +85,17 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } diff --git a/samples/client/petstore/go/go-petstore/format_test.go b/samples/client/petstore/go/go-petstore/format_test.go index 9ced730ad6d..b8bcb738fd6 100644 --- a/samples/client/petstore/go/go-petstore/format_test.go +++ b/samples/client/petstore/go/go-petstore/format_test.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/has_only_read_only.go b/samples/client/petstore/go/go-petstore/has_only_read_only.go index 4ac6a1237a9..a9231320059 100644 --- a/samples/client/petstore/go/go-petstore/has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore/has_only_read_only.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/list.go b/samples/client/petstore/go/go-petstore/list.go index c52e011d665..1d4033a09c0 100644 --- a/samples/client/petstore/go/go-petstore/list.go +++ b/samples/client/petstore/go/go-petstore/list.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/map_test.go b/samples/client/petstore/go/go-petstore/map_test.go index ede75865a72..c94c171040a 100644 --- a/samples/client/petstore/go/go-petstore/map_test.go +++ b/samples/client/petstore/go/go-petstore/map_test.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go index ca571af65be..ea21910e4ee 100644 --- a/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/model_200_response.go b/samples/client/petstore/go/go-petstore/model_200_response.go index a596e8bd73b..ab8f557f377 100644 --- a/samples/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/client/petstore/go/go-petstore/model_200_response.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/model_api_response.go b/samples/client/petstore/go/go-petstore/model_api_response.go index 603e2c92750..2ca2e3c8160 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/model_return.go b/samples/client/petstore/go/go-petstore/model_return.go index b6c387f4bce..b2cfff1d727 100644 --- a/samples/client/petstore/go/go-petstore/model_return.go +++ b/samples/client/petstore/go/go-petstore/model_return.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/name.go b/samples/client/petstore/go/go-petstore/name.go index 0aa3a8c4b04..c4d3cd5a099 100644 --- a/samples/client/petstore/go/go-petstore/name.go +++ b/samples/client/petstore/go/go-petstore/name.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/number_only.go b/samples/client/petstore/go/go-petstore/number_only.go index 23a4c82d235..3c5adb8ba79 100644 --- a/samples/client/petstore/go/go-petstore/number_only.go +++ b/samples/client/petstore/go/go-petstore/number_only.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/order.go b/samples/client/petstore/go/go-petstore/order.go index 55c9cfd7898..8e6f48e265a 100644 --- a/samples/client/petstore/go/go-petstore/order.go +++ b/samples/client/petstore/go/go-petstore/order.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_boolean.go b/samples/client/petstore/go/go-petstore/outer_boolean.go index 07b1230bfd9..dc9ceb0c67e 100644 --- a/samples/client/petstore/go/go-petstore/outer_boolean.go +++ b/samples/client/petstore/go/go-petstore/outer_boolean.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_composite.go b/samples/client/petstore/go/go-petstore/outer_composite.go index db0ccece4b5..3b40bfc5b52 100644 --- a/samples/client/petstore/go/go-petstore/outer_composite.go +++ b/samples/client/petstore/go/go-petstore/outer_composite.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_enum.go b/samples/client/petstore/go/go-petstore/outer_enum.go index 569b3ecaafa..0e724d17c5c 100644 --- a/samples/client/petstore/go/go-petstore/outer_enum.go +++ b/samples/client/petstore/go/go-petstore/outer_enum.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_number.go b/samples/client/petstore/go/go-petstore/outer_number.go index c5d68320690..75aad986c34 100644 --- a/samples/client/petstore/go/go-petstore/outer_number.go +++ b/samples/client/petstore/go/go-petstore/outer_number.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_string.go b/samples/client/petstore/go/go-petstore/outer_string.go index eeab75cd96c..f2a440337bd 100644 --- a/samples/client/petstore/go/go-petstore/outer_string.go +++ b/samples/client/petstore/go/go-petstore/outer_string.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/pet.go b/samples/client/petstore/go/go-petstore/pet.go index cf12df89663..11bf78166c5 100644 --- a/samples/client/petstore/go/go-petstore/pet.go +++ b/samples/client/petstore/go/go-petstore/pet.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/pet_api.go b/samples/client/petstore/go/go-petstore/pet_api.go index ae565a8f511..bad7545d144 100644 --- a/samples/client/petstore/go/go-petstore/pet_api.go +++ b/samples/client/petstore/go/go-petstore/pet_api.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -77,14 +77,14 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) ( *http.Response, return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -144,14 +144,14 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -204,17 +204,17 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -269,17 +269,17 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -346,17 +346,17 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *htt return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -411,14 +411,14 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) ( *http.Respons return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -485,14 +485,14 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -563,17 +563,17 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } diff --git a/samples/client/petstore/go/go-petstore/read_only_first.go b/samples/client/petstore/go/go-petstore/read_only_first.go index ef235fe459f..ec46cccb099 100644 --- a/samples/client/petstore/go/go-petstore/read_only_first.go +++ b/samples/client/petstore/go/go-petstore/read_only_first.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/special_model_name.go b/samples/client/petstore/go/go-petstore/special_model_name.go index b14a0d7f234..46f51fab939 100644 --- a/samples/client/petstore/go/go-petstore/special_model_name.go +++ b/samples/client/petstore/go/go-petstore/special_model_name.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index eaf6ea785cd..85b2f6900a0 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -74,14 +74,14 @@ func (a *StoreApiService) DeleteOrder(orderId string) ( *http.Response, error) { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -143,17 +143,17 @@ func (a *StoreApiService) GetInventory(ctx context.Context, ) (map[string]int32, return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -183,10 +183,10 @@ func (a *StoreApiService) GetOrderById(orderId int64) (Order, *http.Response, e localVarFormParams := url.Values{} if orderId < 1 { - return successPayload, nil, reportError("orderId must be greater than 1") + return successPayload, nil, reportError("orderId must be greater than 1") } if orderId > 5 { - return successPayload, nil, reportError("orderId must be less than 5") + return successPayload, nil, reportError("orderId must be less than 5") } // to determine the Content-Type header @@ -214,17 +214,17 @@ func (a *StoreApiService) GetOrderById(orderId int64) (Order, *http.Response, e return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -280,17 +280,17 @@ func (a *StoreApiService) PlaceOrder(body Order) (Order, *http.Response, error) return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } diff --git a/samples/client/petstore/go/go-petstore/tag.go b/samples/client/petstore/go/go-petstore/tag.go index 2597fbd379b..4c0c279e41c 100644 --- a/samples/client/petstore/go/go-petstore/tag.go +++ b/samples/client/petstore/go/go-petstore/tag.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/user.go b/samples/client/petstore/go/go-petstore/user.go index 739a5f5bf40..6577365f61c 100644 --- a/samples/client/petstore/go/go-petstore/user.go +++ b/samples/client/petstore/go/go-petstore/user.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/user_api.go b/samples/client/petstore/go/go-petstore/user_api.go index a2e37d35dbf..49b2e925558 100644 --- a/samples/client/petstore/go/go-petstore/user_api.go +++ b/samples/client/petstore/go/go-petstore/user_api.go @@ -3,9 +3,9 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -75,14 +75,14 @@ func (a *UserApiService) CreateUser(body User) ( *http.Response, error) { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -135,14 +135,14 @@ func (a *UserApiService) CreateUsersWithArrayInput(body []User) ( *http.Response return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -195,14 +195,14 @@ func (a *UserApiService) CreateUsersWithListInput(body []User) ( *http.Response, return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -254,14 +254,14 @@ func (a *UserApiService) DeleteUser(username string) ( *http.Response, error) { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -314,17 +314,17 @@ func (a *UserApiService) GetUserByName(username string) (User, *http.Response, return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -381,17 +381,17 @@ func (a *UserApiService) LoginUser(username string, password string) (string, * return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -443,14 +443,14 @@ func (a *UserApiService) LogoutUser() ( *http.Response, error) { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -505,14 +505,14 @@ func (a *UserApiService) UpdateUser(username string, body User) ( *http.Response return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err }