From 6776142d2e0a05fe77610b62ab8c8c70add2c017 Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Wed, 9 Dec 2020 12:18:37 +0530 Subject: [PATCH 01/11] error to GenericOpenAPIError --- .../src/main/resources/go/api.mustache | 47 ++- .../go/go-petstore/api_another_fake.go | 26 +- .../petstore/go/go-petstore/api_fake.go | 381 +++++++++++------- .../go-petstore/api_fake_classname_tags123.go | 26 +- .../client/petstore/go/go-petstore/api_pet.go | 214 ++++++---- .../petstore/go/go-petstore/api_store.go | 98 +++-- .../petstore/go/go-petstore/api_user.go | 195 +++++---- .../go-experimental/api_usage.go | 81 ++-- .../go/go-petstore/api_another_fake.go | 26 +- .../petstore/go/go-petstore/api_default.go | 23 +- .../petstore/go/go-petstore/api_fake.go | 378 ++++++++++------- .../go-petstore/api_fake_classname_tags123.go | 26 +- .../client/petstore/go/go-petstore/api_pet.go | 214 ++++++---- .../petstore/go/go-petstore/api_store.go | 98 +++-- .../petstore/go/go-petstore/api_user.go | 195 +++++---- 15 files changed, 1305 insertions(+), 723 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 5486bde9dde0..975d3983abd1 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -3,6 +3,7 @@ package {{packageName}} {{#operations}} import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -35,7 +36,7 @@ type {{classname}} interface { * {{nickname}}Execute executes the request{{#returnType}} * @return {{{.}}}{{/returnType}} */ - {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) + {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, GenericOpenAPIError) {{/operation}} } {{/generateInterfaces}} @@ -60,7 +61,7 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Reques return r }{{/isPathParam}}{{/allParams}} -func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { +func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.{{nickname}}Execute(r) } @@ -85,13 +86,14 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#pathParam * Execute executes the request{{#returnType}} * @return {{{.}}}{{/returnType}} */ -func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { +func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.Method{{httpMethod}} localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError {{#returnType}} localVarReturnValue {{{.}}} {{/returnType}} @@ -99,7 +101,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError} } localVarPath := localBasePath + "{{{path}}}"{{#pathParams}} @@ -112,27 +115,32 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{#required}} {{^isPathParam}} if r.{{paramName}} == nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} is required and must be specified") + executionError.error = "{{paramName}} is required and must be specified" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/isPathParam}} {{#minItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minItems}} { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") + executionError.error = "{{paramName}} must have at least {{minItems}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minItems}} {{#maxItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxItems}} { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") + executionError.error = "{{paramName}} must have less than {{maxItems}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maxItems}} {{#minLength}} if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minLength}} { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") + executionError.error = "{{paramName}} must have at least {{minLength}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minLength}} {{#maxLength}} if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxLength}} { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") + executionError.error = "{{paramName}} must have less than {{maxLength}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maxLength}} {{#minimum}} @@ -143,7 +151,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{^isString}} if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} < {{minimum}} { {{/isString}} - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") + executionError.error = "{{paramName}} must be greater than {{minimum}}" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minimum}} {{#maximum}} @@ -154,7 +163,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{^isString}} if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} > {{maximum}} { {{/isString}} - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") + executionError.error = "{{paramName}} must be less than {{maximum}}" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maximum}} {{/required}} @@ -257,7 +267,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class if r.{{paramName}} != nil { paramJson, err := parameterToJson(*r.{{paramName}}) if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err + executionError.error = err.Error() + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarFormParams.Add("{{baseName}}", paramJson) } @@ -312,18 +323,22 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{/authMethods}} req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err + executionError.error = err.Error() + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err + executionError.error = err.Error() + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err + executionError.error = err.Error() + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -369,7 +384,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class } {{/returnType}} - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, nil + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } {{/operation}} {{/operations}} diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index 56c9345d5e32..0829cdf0d354 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -36,7 +37,7 @@ type AnotherFakeApi interface { * Call123TestSpecialTagsExecute executes the request * @return Client */ - Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) + Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, GenericOpenAPIError) } // AnotherFakeApiService AnotherFakeApi service @@ -53,7 +54,7 @@ func (r ApiCall123TestSpecialTagsRequest) Body(body Client) ApiCall123TestSpecia return r } -func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.Call123TestSpecialTagsExecute(r) } @@ -74,19 +75,21 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) Api * Execute executes the request * @return Client */ -func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/another-fake/dummy" @@ -95,7 +98,8 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -119,18 +123,22 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -150,5 +158,5 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 92ef1bf22fcb..39db3a7d3e49 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -38,7 +39,7 @@ type FakeApi interface { /* * CreateXmlItemExecute executes the request */ - CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, error) + CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, GenericOpenAPIError) /* * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize @@ -52,7 +53,7 @@ type FakeApi interface { * FakeOuterBooleanSerializeExecute executes the request * @return bool */ - FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) + FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, GenericOpenAPIError) /* * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize @@ -66,7 +67,7 @@ type FakeApi interface { * FakeOuterCompositeSerializeExecute executes the request * @return OuterComposite */ - FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) + FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, GenericOpenAPIError) /* * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize @@ -80,7 +81,7 @@ type FakeApi interface { * FakeOuterNumberSerializeExecute executes the request * @return float32 */ - FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) + FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, GenericOpenAPIError) /* * FakeOuterStringSerialize Method for FakeOuterStringSerialize @@ -94,7 +95,7 @@ type FakeApi interface { * FakeOuterStringSerializeExecute executes the request * @return string */ - FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) + FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, GenericOpenAPIError) /* * TestBodyWithFileSchema Method for TestBodyWithFileSchema @@ -107,7 +108,7 @@ type FakeApi interface { /* * TestBodyWithFileSchemaExecute executes the request */ - TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) + TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestBodyWithQueryParams Method for TestBodyWithQueryParams @@ -119,7 +120,7 @@ type FakeApi interface { /* * TestBodyWithQueryParamsExecute executes the request */ - TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) + TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestClientModel To test \"client\" model @@ -133,7 +134,7 @@ type FakeApi interface { * TestClientModelExecute executes the request * @return Client */ - TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) + TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, GenericOpenAPIError) /* * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -149,7 +150,7 @@ type FakeApi interface { /* * TestEndpointParametersExecute executes the request */ - TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) + TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestEnumParameters To test enum parameters @@ -162,7 +163,7 @@ type FakeApi interface { /* * TestEnumParametersExecute executes the request */ - TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) + TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestGroupParameters Fake endpoint to test group parameters (optional) @@ -175,7 +176,7 @@ type FakeApi interface { /* * TestGroupParametersExecute executes the request */ - TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) + TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestInlineAdditionalProperties test inline additionalProperties @@ -187,7 +188,7 @@ type FakeApi interface { /* * TestInlineAdditionalPropertiesExecute executes the request */ - TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) + TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestJsonFormData test json serialization of form data @@ -199,7 +200,7 @@ type FakeApi interface { /* * TestJsonFormDataExecute executes the request */ - TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) + TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat @@ -212,7 +213,7 @@ type FakeApi interface { /* * TestQueryParameterCollectionFormatExecute executes the request */ - TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) + TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, GenericOpenAPIError) } // FakeApiService FakeApi service @@ -229,7 +230,7 @@ func (r ApiCreateXmlItemRequest) XmlItem(xmlItem XmlItem) ApiCreateXmlItemReques return r } -func (r ApiCreateXmlItemRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateXmlItemRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.CreateXmlItemExecute(r) } @@ -249,18 +250,20 @@ func (a *FakeApiService) CreateXmlItem(ctx _context.Context) ApiCreateXmlItemReq /* * Execute executes the request */ -func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/create_xml_item" @@ -269,7 +272,8 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.xmlItem == nil { - return nil, reportError("xmlItem is required and must be specified") + executionError.error = "xmlItem is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -293,18 +297,22 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarPostBody = r.xmlItem req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -315,7 +323,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiFakeOuterBooleanSerializeRequest struct { @@ -329,7 +337,7 @@ func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBoolean return r } -func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { +func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeOuterBooleanSerializeExecute(r) } @@ -350,19 +358,21 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFake * Execute executes the request * @return bool */ -func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/outer/boolean" @@ -392,18 +402,22 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -423,7 +437,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFakeOuterCompositeSerializeRequest struct { @@ -437,7 +451,7 @@ func (r ApiFakeOuterCompositeSerializeRequest) Body(body OuterComposite) ApiFake return r } -func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { +func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeOuterCompositeSerializeExecute(r) } @@ -458,19 +472,21 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFa * Execute executes the request * @return OuterComposite */ -func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/outer/composite" @@ -500,18 +516,22 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -531,7 +551,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFakeOuterNumberSerializeRequest struct { @@ -545,7 +565,7 @@ func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumbe return r } -func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { +func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeOuterNumberSerializeExecute(r) } @@ -566,19 +586,21 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeO * Execute executes the request * @return float32 */ -func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue float32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/outer/number" @@ -608,18 +630,22 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -639,7 +665,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFakeOuterStringSerializeRequest struct { @@ -653,7 +679,7 @@ func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterString return r } -func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeOuterStringSerializeExecute(r) } @@ -674,19 +700,21 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeO * Execute executes the request * @return string */ -func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/outer/string" @@ -716,18 +744,22 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -747,7 +779,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiTestBodyWithFileSchemaRequest struct { @@ -761,7 +793,7 @@ func (r ApiTestBodyWithFileSchemaRequest) Body(body FileSchemaTestClass) ApiTest return r } -func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestBodyWithFileSchemaExecute(r) } @@ -781,18 +813,20 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBod /* * Execute executes the request */ -func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/body-with-file-schema" @@ -801,7 +835,8 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -825,18 +860,22 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -847,7 +886,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestBodyWithQueryParamsRequest struct { @@ -866,7 +905,7 @@ func (r ApiTestBodyWithQueryParamsRequest) Body(body User) ApiTestBodyWithQueryP return r } -func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestBodyWithQueryParamsExecute(r) } @@ -885,18 +924,20 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBo /* * Execute executes the request */ -func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/body-with-query-params" @@ -905,10 +946,12 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.query == nil { - return nil, reportError("query is required and must be specified") + executionError.error = "query is required and must be specified" + return nil, executionError } if r.body == nil { - return nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return nil, executionError } localVarQueryParams.Add("query", parameterToString(*r.query, "")) @@ -933,18 +976,22 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -955,7 +1002,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestClientModelRequest struct { @@ -969,7 +1016,7 @@ func (r ApiTestClientModelRequest) Body(body Client) ApiTestClientModelRequest { return r } -func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestClientModelExecute(r) } @@ -990,19 +1037,21 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientMode * Execute executes the request * @return Client */ -func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) { +func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake" @@ -1011,7 +1060,8 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -1035,18 +1085,22 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1066,7 +1120,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiTestEndpointParametersRequest struct { @@ -1145,7 +1199,7 @@ func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpo return r } -func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestEndpointParametersExecute(r) } @@ -1168,18 +1222,20 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEnd /* * Execute executes the request */ -func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake" @@ -1188,28 +1244,36 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.number == nil { - return nil, reportError("number is required and must be specified") + executionError.error = "number is required and must be specified" + return nil, executionError } if *r.number < 32.1 { - return nil, reportError("number must be greater than 32.1") + executionError.error = "number must be greater than 32.1" + return nil, executionError } if *r.number > 543.2 { - return nil, reportError("number must be less than 543.2") + executionError.error = "number must be less than 543.2" + return nil, executionError } if r.double == nil { - return nil, reportError("double is required and must be specified") + executionError.error = "double is required and must be specified" + return nil, executionError } if *r.double < 67.8 { - return nil, reportError("double must be greater than 67.8") + executionError.error = "double must be greater than 67.8" + return nil, executionError } if *r.double > 123.4 { - return nil, reportError("double must be less than 123.4") + executionError.error = "double must be less than 123.4" + return nil, executionError } if r.patternWithoutDelimiter == nil { - return nil, reportError("patternWithoutDelimiter is required and must be specified") + executionError.error = "patternWithoutDelimiter is required and must be specified" + return nil, executionError } if r.byte_ == nil { - return nil, reportError("byte_ is required and must be specified") + executionError.error = "byte_ is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -1273,18 +1337,22 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1295,7 +1363,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestEnumParametersRequest struct { @@ -1344,7 +1412,7 @@ func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiT return r } -func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestEnumParametersExecute(r) } @@ -1364,18 +1432,20 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumPar /* * Execute executes the request */ -func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake" @@ -1427,18 +1497,22 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1449,7 +1523,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestGroupParametersRequest struct { @@ -1488,7 +1562,7 @@ func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroup return r } -func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestGroupParametersExecute(r) } @@ -1508,18 +1582,20 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupP /* * Execute executes the request */ -func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake" @@ -1528,13 +1604,16 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredStringGroup == nil { - return nil, reportError("requiredStringGroup is required and must be specified") + executionError.error = "requiredStringGroup is required and must be specified" + return nil, executionError } if r.requiredBooleanGroup == nil { - return nil, reportError("requiredBooleanGroup is required and must be specified") + executionError.error = "requiredBooleanGroup is required and must be specified" + return nil, executionError } if r.requiredInt64Group == nil { - return nil, reportError("requiredInt64Group is required and must be specified") + executionError.error = "requiredInt64Group is required and must be specified" + return nil, executionError } localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, "")) @@ -1568,18 +1647,22 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1590,7 +1673,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestInlineAdditionalPropertiesRequest struct { @@ -1604,7 +1687,7 @@ func (r ApiTestInlineAdditionalPropertiesRequest) Param(param map[string]string) return r } -func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestInlineAdditionalPropertiesExecute(r) } @@ -1623,18 +1706,20 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) Ap /* * Execute executes the request */ -func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/inline-additionalProperties" @@ -1643,7 +1728,8 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - return nil, reportError("param is required and must be specified") + executionError.error = "param is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -1667,18 +1753,22 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarPostBody = r.param req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1689,7 +1779,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestJsonFormDataRequest struct { @@ -1708,7 +1798,7 @@ func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataReq return r } -func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestJsonFormDataExecute(r) } @@ -1727,18 +1817,20 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormD /* * Execute executes the request */ -func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/jsonFormData" @@ -1747,10 +1839,12 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - return nil, reportError("param is required and must be specified") + executionError.error = "param is required and must be specified" + return nil, executionError } if r.param2 == nil { - return nil, reportError("param2 is required and must be specified") + executionError.error = "param2 is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -1774,18 +1868,22 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormParams.Add("param2", parameterToString(*r.param2, "")) req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1796,7 +1894,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestQueryParameterCollectionFormatRequest struct { @@ -1830,7 +1928,7 @@ func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) return r } -func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestQueryParameterCollectionFormatExecute(r) } @@ -1850,18 +1948,20 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context /* * Execute executes the request */ -func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/test-query-paramters" @@ -1870,19 +1970,24 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pipe == nil { - return nil, reportError("pipe is required and must be specified") + executionError.error = "pipe is required and must be specified" + return nil, executionError } if r.ioutil == nil { - return nil, reportError("ioutil is required and must be specified") + executionError.error = "ioutil is required and must be specified" + return nil, executionError } if r.http == nil { - return nil, reportError("http is required and must be specified") + executionError.error = "http is required and must be specified" + return nil, executionError } if r.url == nil { - return nil, reportError("url is required and must be specified") + executionError.error = "url is required and must be specified" + return nil, executionError } if r.context == nil { - return nil, reportError("context is required and must be specified") + executionError.error = "context is required and must be specified" + return nil, executionError } localVarQueryParams.Add("pipe", parameterToString(*r.pipe, "csv")) @@ -1919,18 +2024,22 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1941,5 +2050,5 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index c032657de757..cd09afa06a86 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -36,7 +37,7 @@ type FakeClassnameTags123Api interface { * TestClassnameExecute executes the request * @return Client */ - TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) + TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, GenericOpenAPIError) } // FakeClassnameTags123ApiService FakeClassnameTags123Api service @@ -53,7 +54,7 @@ func (r ApiTestClassnameRequest) Body(body Client) ApiTestClassnameRequest { return r } -func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestClassnameExecute(r) } @@ -74,19 +75,21 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) Api * Execute executes the request * @return Client */ -func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake_classname_test" @@ -95,7 +98,8 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -133,18 +137,22 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -164,5 +172,5 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index da68df83dda0..a71a262c6707 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -36,7 +37,7 @@ type PetApi interface { /* * AddPetExecute executes the request */ - AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) + AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, GenericOpenAPIError) /* * DeletePet Deletes a pet @@ -49,7 +50,7 @@ type PetApi interface { /* * DeletePetExecute executes the request */ - DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) + DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, GenericOpenAPIError) /* * FindPetsByStatus Finds Pets by status @@ -63,7 +64,7 @@ type PetApi interface { * FindPetsByStatusExecute executes the request * @return []Pet */ - FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) + FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, GenericOpenAPIError) /* * FindPetsByTags Finds Pets by tags @@ -77,7 +78,7 @@ type PetApi interface { * FindPetsByTagsExecute executes the request * @return []Pet */ - FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) + FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, GenericOpenAPIError) /* * GetPetById Find pet by ID @@ -92,7 +93,7 @@ type PetApi interface { * GetPetByIdExecute executes the request * @return Pet */ - GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) + GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, GenericOpenAPIError) /* * UpdatePet Update an existing pet @@ -104,7 +105,7 @@ type PetApi interface { /* * UpdatePetExecute executes the request */ - UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) + UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, GenericOpenAPIError) /* * UpdatePetWithForm Updates a pet in the store with form data @@ -117,7 +118,7 @@ type PetApi interface { /* * UpdatePetWithFormExecute executes the request */ - UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) + UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, GenericOpenAPIError) /* * UploadFile uploads an image @@ -131,7 +132,7 @@ type PetApi interface { * UploadFileExecute executes the request * @return ApiResponse */ - UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) + UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, GenericOpenAPIError) /* * UploadFileWithRequiredFile uploads an image (required) @@ -145,7 +146,7 @@ type PetApi interface { * UploadFileWithRequiredFileExecute executes the request * @return ApiResponse */ - UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) + UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, GenericOpenAPIError) } // PetApiService PetApi service @@ -162,7 +163,7 @@ func (r ApiAddPetRequest) Body(body Pet) ApiAddPetRequest { return r } -func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAddPetRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.AddPetExecute(r) } @@ -181,18 +182,20 @@ func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { /* * Execute executes the request */ -func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/pet" @@ -201,7 +204,8 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -225,18 +229,22 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -247,7 +255,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiDeletePetRequest struct { @@ -262,7 +270,7 @@ func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest { return r } -func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.DeletePetExecute(r) } @@ -283,18 +291,20 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePe /* * Execute executes the request */ -func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/pet/{petId}" @@ -326,18 +336,22 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -348,7 +362,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiFindPetsByStatusRequest struct { @@ -362,7 +376,7 @@ func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusR return r } -func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FindPetsByStatusExecute(r) } @@ -383,19 +397,21 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStat * Execute executes the request * @return []Pet */ -func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/pet/findByStatus" @@ -404,7 +420,8 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.status == nil { - return localVarReturnValue, nil, reportError("status is required and must be specified") + executionError.error = "status is required and must be specified" + return localVarReturnValue, nil, executionError } localVarQueryParams.Add("status", parameterToString(*r.status, "csv")) @@ -427,18 +444,22 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -458,7 +479,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFindPetsByTagsRequest struct { @@ -472,7 +493,7 @@ func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest { return r } -func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FindPetsByTagsExecute(r) } @@ -493,19 +514,21 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRe * Execute executes the request * @return []Pet */ -func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/pet/findByTags" @@ -514,7 +537,8 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.tags == nil { - return localVarReturnValue, nil, reportError("tags is required and must be specified") + executionError.error = "tags is required and must be specified" + return localVarReturnValue, nil, executionError } localVarQueryParams.Add("tags", parameterToString(*r.tags, "csv")) @@ -537,18 +561,22 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -568,7 +596,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiGetPetByIdRequest struct { @@ -578,7 +606,7 @@ type ApiGetPetByIdRequest struct { } -func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { +func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.GetPetByIdExecute(r) } @@ -601,19 +629,21 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetB * Execute executes the request * @return Pet */ -func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) { +func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/pet/{petId}" @@ -656,18 +686,22 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -687,7 +721,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiUpdatePetRequest struct { @@ -701,7 +735,7 @@ func (r ApiUpdatePetRequest) Body(body Pet) ApiUpdatePetRequest { return r } -func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UpdatePetExecute(r) } @@ -720,18 +754,20 @@ func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { /* * Execute executes the request */ -func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/pet" @@ -740,7 +776,8 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -764,18 +801,22 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -786,7 +827,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiUpdatePetWithFormRequest struct { @@ -806,7 +847,7 @@ func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormR return r } -func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UpdatePetWithFormExecute(r) } @@ -827,18 +868,20 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) Api /* * Execute executes the request */ -func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/pet/{petId}" @@ -873,18 +916,22 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -895,7 +942,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiUploadFileRequest struct { @@ -915,7 +962,7 @@ func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { return r } -func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { +func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UploadFileExecute(r) } @@ -937,19 +984,21 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadF * Execute executes the request * @return ApiResponse */ -func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/pet/{petId}/uploadImage" @@ -992,18 +1041,22 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1023,7 +1076,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiUploadFileWithRequiredFileRequest struct { @@ -1043,7 +1096,7 @@ func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetad return r } -func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { +func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UploadFileWithRequiredFileExecute(r) } @@ -1065,19 +1118,21 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i * Execute executes the request * @return ApiResponse */ -func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" @@ -1087,7 +1142,8 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredFile == nil { - return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") + executionError.error = "requiredFile is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -1120,18 +1176,22 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1151,5 +1211,5 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 0b5853274dd6..e0281ced9743 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -37,7 +38,7 @@ type StoreApi interface { /* * DeleteOrderExecute executes the request */ - DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) + DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, GenericOpenAPIError) /* * GetInventory Returns pet inventories by status @@ -51,7 +52,7 @@ type StoreApi interface { * GetInventoryExecute executes the request * @return map[string]int32 */ - GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) + GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, GenericOpenAPIError) /* * GetOrderById Find purchase order by ID @@ -66,7 +67,7 @@ type StoreApi interface { * GetOrderByIdExecute executes the request * @return Order */ - GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) + GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, GenericOpenAPIError) /* * PlaceOrder Place an order for a pet @@ -79,7 +80,7 @@ type StoreApi interface { * PlaceOrderExecute executes the request * @return Order */ - PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) + PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, GenericOpenAPIError) } // StoreApiService StoreApi service @@ -92,7 +93,7 @@ type ApiDeleteOrderRequest struct { } -func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.DeleteOrderExecute(r) } @@ -114,18 +115,20 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiD /* * Execute executes the request */ -func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) { +func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/store/order/{order_id}" @@ -154,18 +157,22 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -176,7 +183,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiGetInventoryRequest struct { @@ -185,7 +192,7 @@ type ApiGetInventoryRequest struct { } -func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { +func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.GetInventoryExecute(r) } @@ -206,19 +213,21 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequ * Execute executes the request * @return map[string]int32 */ -func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) { +func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue map[string]int32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/store/inventory" @@ -260,18 +269,22 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -291,7 +304,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiGetOrderByIdRequest struct { @@ -301,7 +314,7 @@ type ApiGetOrderByIdRequest struct { } -func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { +func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.GetOrderByIdExecute(r) } @@ -324,19 +337,21 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiG * Execute executes the request * @return Order */ -func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/store/order/{order_id}" @@ -346,10 +361,12 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.orderId < 1 { - return localVarReturnValue, nil, reportError("orderId must be greater than 1") + executionError.error = "orderId must be greater than 1" + return localVarReturnValue, nil, executionError } if r.orderId > 5 { - return localVarReturnValue, nil, reportError("orderId must be less than 5") + executionError.error = "orderId must be less than 5" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -371,18 +388,22 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -402,7 +423,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiPlaceOrderRequest struct { @@ -416,7 +437,7 @@ func (r ApiPlaceOrderRequest) Body(body Order) ApiPlaceOrderRequest { return r } -func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { +func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.PlaceOrderExecute(r) } @@ -436,19 +457,21 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest * Execute executes the request * @return Order */ -func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/store/order" @@ -457,7 +480,8 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -481,18 +505,22 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -512,5 +540,5 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 6f8185f704bd..b74528003901 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -36,7 +37,7 @@ type UserApi interface { /* * CreateUserExecute executes the request */ - CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) + CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, GenericOpenAPIError) /* * CreateUsersWithArrayInput Creates list of users with given input array @@ -48,7 +49,7 @@ type UserApi interface { /* * CreateUsersWithArrayInputExecute executes the request */ - CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) + CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, GenericOpenAPIError) /* * CreateUsersWithListInput Creates list of users with given input array @@ -60,7 +61,7 @@ type UserApi interface { /* * CreateUsersWithListInputExecute executes the request */ - CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) + CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, GenericOpenAPIError) /* * DeleteUser Delete user @@ -74,7 +75,7 @@ type UserApi interface { /* * DeleteUserExecute executes the request */ - DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) + DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, GenericOpenAPIError) /* * GetUserByName Get user by user name @@ -88,7 +89,7 @@ type UserApi interface { * GetUserByNameExecute executes the request * @return User */ - GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) + GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, GenericOpenAPIError) /* * LoginUser Logs user into the system @@ -101,7 +102,7 @@ type UserApi interface { * LoginUserExecute executes the request * @return string */ - LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) + LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, GenericOpenAPIError) /* * LogoutUser Logs out current logged in user session @@ -113,7 +114,7 @@ type UserApi interface { /* * LogoutUserExecute executes the request */ - LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) + LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, GenericOpenAPIError) /* * UpdateUser Updated user @@ -127,7 +128,7 @@ type UserApi interface { /* * UpdateUserExecute executes the request */ - UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) + UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, GenericOpenAPIError) } // UserApiService UserApi service @@ -144,7 +145,7 @@ func (r ApiCreateUserRequest) Body(body User) ApiCreateUserRequest { return r } -func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.CreateUserExecute(r) } @@ -164,18 +165,20 @@ func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { /* * Execute executes the request */ -func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user" @@ -184,7 +187,8 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -208,18 +212,22 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -230,7 +238,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiCreateUsersWithArrayInputRequest struct { @@ -244,7 +252,7 @@ func (r ApiCreateUsersWithArrayInputRequest) Body(body []User) ApiCreateUsersWit return r } -func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.CreateUsersWithArrayInputExecute(r) } @@ -263,18 +271,20 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCrea /* * Execute executes the request */ -func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/createWithArray" @@ -283,7 +293,8 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -307,18 +318,22 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -329,7 +344,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiCreateUsersWithListInputRequest struct { @@ -343,7 +358,7 @@ func (r ApiCreateUsersWithListInputRequest) Body(body []User) ApiCreateUsersWith return r } -func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.CreateUsersWithListInputExecute(r) } @@ -362,18 +377,20 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreat /* * Execute executes the request */ -func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/createWithList" @@ -382,7 +399,8 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -406,18 +424,22 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -428,7 +450,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiDeleteUserRequest struct { @@ -438,7 +460,7 @@ type ApiDeleteUserRequest struct { } -func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.DeleteUserExecute(r) } @@ -460,18 +482,20 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDe /* * Execute executes the request */ -func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/{username}" @@ -500,18 +524,22 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -522,7 +550,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiGetUserByNameRequest struct { @@ -532,7 +560,7 @@ type ApiGetUserByNameRequest struct { } -func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { +func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.GetUserByNameExecute(r) } @@ -554,19 +582,21 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) Ap * Execute executes the request * @return User */ -func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) { +func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/user/{username}" @@ -595,18 +625,22 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -626,7 +660,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiLoginUserRequest struct { @@ -645,7 +679,7 @@ func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { return r } -func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.LoginUserExecute(r) } @@ -665,19 +699,21 @@ func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { * Execute executes the request * @return string */ -func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) { +func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/user/login" @@ -686,10 +722,12 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.username == nil { - return localVarReturnValue, nil, reportError("username is required and must be specified") + executionError.error = "username is required and must be specified" + return localVarReturnValue, nil, executionError } if r.password == nil { - return localVarReturnValue, nil, reportError("password is required and must be specified") + executionError.error = "password is required and must be specified" + return localVarReturnValue, nil, executionError } localVarQueryParams.Add("username", parameterToString(*r.username, "")) @@ -713,18 +751,22 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -744,7 +786,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiLogoutUserRequest struct { @@ -753,7 +795,7 @@ type ApiLogoutUserRequest struct { } -func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.LogoutUserExecute(r) } @@ -772,18 +814,20 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { /* * Execute executes the request */ -func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/logout" @@ -811,18 +855,22 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -833,7 +881,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiUpdateUserRequest struct { @@ -848,7 +896,7 @@ func (r ApiUpdateUserRequest) Body(body User) ApiUpdateUserRequest { return r } -func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UpdateUserExecute(r) } @@ -870,18 +918,20 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUp /* * Execute executes the request */ -func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/{username}" @@ -891,7 +941,8 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - return nil, reportError("body is required and must be specified") + executionError.error = "body is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -915,18 +966,22 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -937,5 +992,5 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index cb0ea16b894a..0037af7d3d60 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -11,6 +11,7 @@ package x_auth_id_alias import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -31,7 +32,7 @@ type ApiAnyKeyRequest struct { } -func (r ApiAnyKeyRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { +func (r ApiAnyKeyRequest) Execute() (map[string]interface{}, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.AnyKeyExecute(r) } @@ -52,19 +53,21 @@ func (a *UsageApiService) AnyKey(ctx _context.Context) ApiAnyKeyRequest { * Execute executes the request * @return map[string]interface{} */ -func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interface{}, *_nethttp.Response, error) { +func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interface{}, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.AnyKey") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/any" @@ -120,18 +123,22 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -151,7 +158,7 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiBothKeysRequest struct { @@ -160,7 +167,7 @@ type ApiBothKeysRequest struct { } -func (r ApiBothKeysRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { +func (r ApiBothKeysRequest) Execute() (map[string]interface{}, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.BothKeysExecute(r) } @@ -181,19 +188,21 @@ func (a *UsageApiService) BothKeys(ctx _context.Context) ApiBothKeysRequest { * Execute executes the request * @return map[string]interface{} */ -func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]interface{}, *_nethttp.Response, error) { +func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]interface{}, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.BothKeys") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/both" @@ -249,18 +258,22 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -280,7 +293,7 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiKeyInHeaderRequest struct { @@ -289,7 +302,7 @@ type ApiKeyInHeaderRequest struct { } -func (r ApiKeyInHeaderRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { +func (r ApiKeyInHeaderRequest) Execute() (map[string]interface{}, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.KeyInHeaderExecute(r) } @@ -310,19 +323,21 @@ func (a *UsageApiService) KeyInHeader(ctx _context.Context) ApiKeyInHeaderReques * Execute executes the request * @return map[string]interface{} */ -func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[string]interface{}, *_nethttp.Response, error) { +func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[string]interface{}, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInHeader") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/header" @@ -364,18 +379,22 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -395,7 +414,7 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiKeyInQueryRequest struct { @@ -404,7 +423,7 @@ type ApiKeyInQueryRequest struct { } -func (r ApiKeyInQueryRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { +func (r ApiKeyInQueryRequest) Execute() (map[string]interface{}, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.KeyInQueryExecute(r) } @@ -425,19 +444,21 @@ func (a *UsageApiService) KeyInQuery(ctx _context.Context) ApiKeyInQueryRequest * Execute executes the request * @return map[string]interface{} */ -func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string]interface{}, *_nethttp.Response, error) { +func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string]interface{}, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInQuery") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/query" @@ -479,18 +500,22 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -510,5 +535,5 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index 497c6629b055..48f71466db44 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -36,7 +37,7 @@ type AnotherFakeApi interface { * Call123TestSpecialTagsExecute executes the request * @return Client */ - Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) + Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, GenericOpenAPIError) } // AnotherFakeApiService AnotherFakeApi service @@ -53,7 +54,7 @@ func (r ApiCall123TestSpecialTagsRequest) Client(client Client) ApiCall123TestSp return r } -func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.Call123TestSpecialTagsExecute(r) } @@ -74,19 +75,21 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) Api * Execute executes the request * @return Client */ -func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/another-fake/dummy" @@ -95,7 +98,8 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - return localVarReturnValue, nil, reportError("client is required and must be specified") + executionError.error = "client is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -119,18 +123,22 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarPostBody = r.client req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -150,5 +158,5 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index b9a217a0efe6..f0a805a01a4a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -35,7 +36,7 @@ type DefaultApi interface { * FooGetExecute executes the request * @return InlineResponseDefault */ - FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) + FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, GenericOpenAPIError) } // DefaultApiService DefaultApi service @@ -47,7 +48,7 @@ type ApiFooGetRequest struct { } -func (r ApiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, error) { +func (r ApiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FooGetExecute(r) } @@ -67,19 +68,21 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) ApiFooGetRequest { * Execute executes the request * @return InlineResponseDefault */ -func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) { +func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue InlineResponseDefault ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/foo" @@ -107,18 +110,22 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -145,5 +152,5 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index fc9fb9b597e3..44169787df45 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -38,7 +39,7 @@ type FakeApi interface { * FakeHealthGetExecute executes the request * @return HealthCheckResult */ - FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, error) + FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, GenericOpenAPIError) /* * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize @@ -52,7 +53,7 @@ type FakeApi interface { * FakeOuterBooleanSerializeExecute executes the request * @return bool */ - FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) + FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, GenericOpenAPIError) /* * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize @@ -66,7 +67,7 @@ type FakeApi interface { * FakeOuterCompositeSerializeExecute executes the request * @return OuterComposite */ - FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) + FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, GenericOpenAPIError) /* * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize @@ -80,7 +81,7 @@ type FakeApi interface { * FakeOuterNumberSerializeExecute executes the request * @return float32 */ - FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) + FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, GenericOpenAPIError) /* * FakeOuterStringSerialize Method for FakeOuterStringSerialize @@ -94,7 +95,7 @@ type FakeApi interface { * FakeOuterStringSerializeExecute executes the request * @return string */ - FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) + FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, GenericOpenAPIError) /* * TestBodyWithFileSchema Method for TestBodyWithFileSchema @@ -107,7 +108,7 @@ type FakeApi interface { /* * TestBodyWithFileSchemaExecute executes the request */ - TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) + TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestBodyWithQueryParams Method for TestBodyWithQueryParams @@ -119,7 +120,7 @@ type FakeApi interface { /* * TestBodyWithQueryParamsExecute executes the request */ - TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) + TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestClientModel To test \"client\" model @@ -133,7 +134,7 @@ type FakeApi interface { * TestClientModelExecute executes the request * @return Client */ - TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) + TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, GenericOpenAPIError) /* * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -150,7 +151,7 @@ type FakeApi interface { /* * TestEndpointParametersExecute executes the request */ - TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) + TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestEnumParameters To test enum parameters @@ -163,7 +164,7 @@ type FakeApi interface { /* * TestEnumParametersExecute executes the request */ - TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) + TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestGroupParameters Fake endpoint to test group parameters (optional) @@ -176,7 +177,7 @@ type FakeApi interface { /* * TestGroupParametersExecute executes the request */ - TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) + TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestInlineAdditionalProperties test inline additionalProperties @@ -188,7 +189,7 @@ type FakeApi interface { /* * TestInlineAdditionalPropertiesExecute executes the request */ - TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) + TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestJsonFormData test json serialization of form data @@ -200,7 +201,7 @@ type FakeApi interface { /* * TestJsonFormDataExecute executes the request */ - TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) + TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, GenericOpenAPIError) /* * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat @@ -213,7 +214,7 @@ type FakeApi interface { /* * TestQueryParameterCollectionFormatExecute executes the request */ - TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) + TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, GenericOpenAPIError) } // FakeApiService FakeApi service @@ -225,7 +226,7 @@ type ApiFakeHealthGetRequest struct { } -func (r ApiFakeHealthGetRequest) Execute() (HealthCheckResult, *_nethttp.Response, error) { +func (r ApiFakeHealthGetRequest) Execute() (HealthCheckResult, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeHealthGetExecute(r) } @@ -245,19 +246,21 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) ApiFakeHealthGetReq * Execute executes the request * @return HealthCheckResult */ -func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, error) { +func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue HealthCheckResult ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeHealthGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/health" @@ -285,18 +288,22 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -316,7 +323,7 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFakeOuterBooleanSerializeRequest struct { @@ -330,7 +337,7 @@ func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBoolean return r } -func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { +func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeOuterBooleanSerializeExecute(r) } @@ -351,19 +358,21 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFake * Execute executes the request * @return bool */ -func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/outer/boolean" @@ -393,18 +402,22 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -424,7 +437,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFakeOuterCompositeSerializeRequest struct { @@ -438,7 +451,7 @@ func (r ApiFakeOuterCompositeSerializeRequest) OuterComposite(outerComposite Out return r } -func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { +func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeOuterCompositeSerializeExecute(r) } @@ -459,19 +472,21 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFa * Execute executes the request * @return OuterComposite */ -func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/outer/composite" @@ -501,18 +516,22 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarPostBody = r.outerComposite req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -532,7 +551,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFakeOuterNumberSerializeRequest struct { @@ -546,7 +565,7 @@ func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumbe return r } -func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { +func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeOuterNumberSerializeExecute(r) } @@ -567,19 +586,21 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeO * Execute executes the request * @return float32 */ -func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue float32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/outer/number" @@ -609,18 +630,22 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -640,7 +665,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFakeOuterStringSerializeRequest struct { @@ -654,7 +679,7 @@ func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterString return r } -func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FakeOuterStringSerializeExecute(r) } @@ -675,19 +700,21 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeO * Execute executes the request * @return string */ -func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/outer/string" @@ -717,18 +744,22 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -748,7 +779,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiTestBodyWithFileSchemaRequest struct { @@ -762,7 +793,7 @@ func (r ApiTestBodyWithFileSchemaRequest) FileSchemaTestClass(fileSchemaTestClas return r } -func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestBodyWithFileSchemaExecute(r) } @@ -782,18 +813,20 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBod /* * Execute executes the request */ -func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/body-with-file-schema" @@ -802,7 +835,8 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.fileSchemaTestClass == nil { - return nil, reportError("fileSchemaTestClass is required and must be specified") + executionError.error = "fileSchemaTestClass is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -826,18 +860,22 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarPostBody = r.fileSchemaTestClass req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -848,7 +886,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestBodyWithQueryParamsRequest struct { @@ -867,7 +905,7 @@ func (r ApiTestBodyWithQueryParamsRequest) User(user User) ApiTestBodyWithQueryP return r } -func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestBodyWithQueryParamsExecute(r) } @@ -886,18 +924,20 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBo /* * Execute executes the request */ -func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/body-with-query-params" @@ -906,10 +946,12 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.query == nil { - return nil, reportError("query is required and must be specified") + executionError.error = "query is required and must be specified" + return nil, executionError } if r.user == nil { - return nil, reportError("user is required and must be specified") + executionError.error = "user is required and must be specified" + return nil, executionError } localVarQueryParams.Add("query", parameterToString(*r.query, "")) @@ -934,18 +976,22 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -956,7 +1002,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestClientModelRequest struct { @@ -970,7 +1016,7 @@ func (r ApiTestClientModelRequest) Client(client Client) ApiTestClientModelReque return r } -func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestClientModelExecute(r) } @@ -991,19 +1037,21 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientMode * Execute executes the request * @return Client */ -func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) { +func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake" @@ -1012,7 +1060,8 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - return localVarReturnValue, nil, reportError("client is required and must be specified") + executionError.error = "client is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -1036,18 +1085,22 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarPostBody = r.client req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1067,7 +1120,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiTestEndpointParametersRequest struct { @@ -1146,7 +1199,7 @@ func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpo return r } -func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestEndpointParametersExecute(r) } @@ -1170,18 +1223,20 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEnd /* * Execute executes the request */ -func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake" @@ -1190,28 +1245,36 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.number == nil { - return nil, reportError("number is required and must be specified") + executionError.error = "number is required and must be specified" + return nil, executionError } if *r.number < 32.1 { - return nil, reportError("number must be greater than 32.1") + executionError.error = "number must be greater than 32.1" + return nil, executionError } if *r.number > 543.2 { - return nil, reportError("number must be less than 543.2") + executionError.error = "number must be less than 543.2" + return nil, executionError } if r.double == nil { - return nil, reportError("double is required and must be specified") + executionError.error = "double is required and must be specified" + return nil, executionError } if *r.double < 67.8 { - return nil, reportError("double must be greater than 67.8") + executionError.error = "double must be greater than 67.8" + return nil, executionError } if *r.double > 123.4 { - return nil, reportError("double must be less than 123.4") + executionError.error = "double must be less than 123.4" + return nil, executionError } if r.patternWithoutDelimiter == nil { - return nil, reportError("patternWithoutDelimiter is required and must be specified") + executionError.error = "patternWithoutDelimiter is required and must be specified" + return nil, executionError } if r.byte_ == nil { - return nil, reportError("byte_ is required and must be specified") + executionError.error = "byte_ is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -1275,18 +1338,22 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1297,7 +1364,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestEnumParametersRequest struct { @@ -1346,7 +1413,7 @@ func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiT return r } -func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestEnumParametersExecute(r) } @@ -1366,18 +1433,20 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumPar /* * Execute executes the request */ -func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake" @@ -1437,18 +1506,22 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1459,7 +1532,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestGroupParametersRequest struct { @@ -1498,7 +1571,7 @@ func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroup return r } -func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestGroupParametersExecute(r) } @@ -1518,18 +1591,20 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupP /* * Execute executes the request */ -func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake" @@ -1538,13 +1613,16 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredStringGroup == nil { - return nil, reportError("requiredStringGroup is required and must be specified") + executionError.error = "requiredStringGroup is required and must be specified" + return nil, executionError } if r.requiredBooleanGroup == nil { - return nil, reportError("requiredBooleanGroup is required and must be specified") + executionError.error = "requiredBooleanGroup is required and must be specified" + return nil, executionError } if r.requiredInt64Group == nil { - return nil, reportError("requiredInt64Group is required and must be specified") + executionError.error = "requiredInt64Group is required and must be specified" + return nil, executionError } localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, "")) @@ -1578,18 +1656,22 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1600,7 +1682,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestInlineAdditionalPropertiesRequest struct { @@ -1614,7 +1696,7 @@ func (r ApiTestInlineAdditionalPropertiesRequest) RequestBody(requestBody map[st return r } -func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestInlineAdditionalPropertiesExecute(r) } @@ -1633,18 +1715,20 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) Ap /* * Execute executes the request */ -func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/inline-additionalProperties" @@ -1653,7 +1737,8 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requestBody == nil { - return nil, reportError("requestBody is required and must be specified") + executionError.error = "requestBody is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -1677,18 +1762,22 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarPostBody = r.requestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1699,7 +1788,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestJsonFormDataRequest struct { @@ -1718,7 +1807,7 @@ func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataReq return r } -func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestJsonFormDataExecute(r) } @@ -1737,18 +1826,20 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormD /* * Execute executes the request */ -func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/jsonFormData" @@ -1757,10 +1848,12 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - return nil, reportError("param is required and must be specified") + executionError.error = "param is required and must be specified" + return nil, executionError } if r.param2 == nil { - return nil, reportError("param2 is required and must be specified") + executionError.error = "param2 is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -1784,18 +1877,22 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormParams.Add("param2", parameterToString(*r.param2, "")) req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1806,7 +1903,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiTestQueryParameterCollectionFormatRequest struct { @@ -1840,7 +1937,7 @@ func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) return r } -func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestQueryParameterCollectionFormatExecute(r) } @@ -1860,18 +1957,20 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context /* * Execute executes the request */ -func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/fake/test-query-paramters" @@ -1880,19 +1979,24 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pipe == nil { - return nil, reportError("pipe is required and must be specified") + executionError.error = "pipe is required and must be specified" + return nil, executionError } if r.ioutil == nil { - return nil, reportError("ioutil is required and must be specified") + executionError.error = "ioutil is required and must be specified" + return nil, executionError } if r.http == nil { - return nil, reportError("http is required and must be specified") + executionError.error = "http is required and must be specified" + return nil, executionError } if r.url == nil { - return nil, reportError("url is required and must be specified") + executionError.error = "url is required and must be specified" + return nil, executionError } if r.context == nil { - return nil, reportError("context is required and must be specified") + executionError.error = "context is required and must be specified" + return nil, executionError } { @@ -1939,18 +2043,22 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1961,5 +2069,5 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 3ec0cd5efc74..bf7c035e49a3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -36,7 +37,7 @@ type FakeClassnameTags123Api interface { * TestClassnameExecute executes the request * @return Client */ - TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) + TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, GenericOpenAPIError) } // FakeClassnameTags123ApiService FakeClassnameTags123Api service @@ -53,7 +54,7 @@ func (r ApiTestClassnameRequest) Client(client Client) ApiTestClassnameRequest { return r } -func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.TestClassnameExecute(r) } @@ -74,19 +75,21 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) Api * Execute executes the request * @return Client */ -func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake_classname_test" @@ -95,7 +98,8 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - return localVarReturnValue, nil, reportError("client is required and must be specified") + executionError.error = "client is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -133,18 +137,22 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -164,5 +172,5 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index de2a7cca8b29..e48a02897c01 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -36,7 +37,7 @@ type PetApi interface { /* * AddPetExecute executes the request */ - AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) + AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, GenericOpenAPIError) /* * DeletePet Deletes a pet @@ -49,7 +50,7 @@ type PetApi interface { /* * DeletePetExecute executes the request */ - DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) + DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, GenericOpenAPIError) /* * FindPetsByStatus Finds Pets by status @@ -63,7 +64,7 @@ type PetApi interface { * FindPetsByStatusExecute executes the request * @return []Pet */ - FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) + FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, GenericOpenAPIError) /* * FindPetsByTags Finds Pets by tags @@ -77,7 +78,7 @@ type PetApi interface { * FindPetsByTagsExecute executes the request * @return []Pet */ - FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) + FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, GenericOpenAPIError) /* * GetPetById Find pet by ID @@ -92,7 +93,7 @@ type PetApi interface { * GetPetByIdExecute executes the request * @return Pet */ - GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) + GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, GenericOpenAPIError) /* * UpdatePet Update an existing pet @@ -104,7 +105,7 @@ type PetApi interface { /* * UpdatePetExecute executes the request */ - UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) + UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, GenericOpenAPIError) /* * UpdatePetWithForm Updates a pet in the store with form data @@ -117,7 +118,7 @@ type PetApi interface { /* * UpdatePetWithFormExecute executes the request */ - UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) + UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, GenericOpenAPIError) /* * UploadFile uploads an image @@ -131,7 +132,7 @@ type PetApi interface { * UploadFileExecute executes the request * @return ApiResponse */ - UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) + UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, GenericOpenAPIError) /* * UploadFileWithRequiredFile uploads an image (required) @@ -145,7 +146,7 @@ type PetApi interface { * UploadFileWithRequiredFileExecute executes the request * @return ApiResponse */ - UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) + UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, GenericOpenAPIError) } // PetApiService PetApi service @@ -162,7 +163,7 @@ func (r ApiAddPetRequest) Pet(pet Pet) ApiAddPetRequest { return r } -func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAddPetRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.AddPetExecute(r) } @@ -181,18 +182,20 @@ func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { /* * Execute executes the request */ -func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/pet" @@ -201,7 +204,8 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pet == nil { - return nil, reportError("pet is required and must be specified") + executionError.error = "pet is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -225,18 +229,22 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e localVarPostBody = r.pet req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -247,7 +255,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiDeletePetRequest struct { @@ -262,7 +270,7 @@ func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest { return r } -func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.DeletePetExecute(r) } @@ -283,18 +291,20 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePe /* * Execute executes the request */ -func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/pet/{petId}" @@ -326,18 +336,22 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -348,7 +362,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiFindPetsByStatusRequest struct { @@ -362,7 +376,7 @@ func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusR return r } -func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FindPetsByStatusExecute(r) } @@ -383,19 +397,21 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStat * Execute executes the request * @return []Pet */ -func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/pet/findByStatus" @@ -404,7 +420,8 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.status == nil { - return localVarReturnValue, nil, reportError("status is required and must be specified") + executionError.error = "status is required and must be specified" + return localVarReturnValue, nil, executionError } localVarQueryParams.Add("status", parameterToString(*r.status, "csv")) @@ -427,18 +444,22 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -458,7 +479,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiFindPetsByTagsRequest struct { @@ -472,7 +493,7 @@ func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest { return r } -func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.FindPetsByTagsExecute(r) } @@ -493,19 +514,21 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRe * Execute executes the request * @return []Pet */ -func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/pet/findByTags" @@ -514,7 +537,8 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.tags == nil { - return localVarReturnValue, nil, reportError("tags is required and must be specified") + executionError.error = "tags is required and must be specified" + return localVarReturnValue, nil, executionError } localVarQueryParams.Add("tags", parameterToString(*r.tags, "csv")) @@ -537,18 +561,22 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -568,7 +596,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiGetPetByIdRequest struct { @@ -578,7 +606,7 @@ type ApiGetPetByIdRequest struct { } -func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { +func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.GetPetByIdExecute(r) } @@ -601,19 +629,21 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetB * Execute executes the request * @return Pet */ -func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) { +func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/pet/{petId}" @@ -656,18 +686,22 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -687,7 +721,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiUpdatePetRequest struct { @@ -701,7 +735,7 @@ func (r ApiUpdatePetRequest) Pet(pet Pet) ApiUpdatePetRequest { return r } -func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UpdatePetExecute(r) } @@ -720,18 +754,20 @@ func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { /* * Execute executes the request */ -func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/pet" @@ -740,7 +776,8 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pet == nil { - return nil, reportError("pet is required and must be specified") + executionError.error = "pet is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -764,18 +801,22 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarPostBody = r.pet req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -786,7 +827,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiUpdatePetWithFormRequest struct { @@ -806,7 +847,7 @@ func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormR return r } -func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UpdatePetWithFormExecute(r) } @@ -827,18 +868,20 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) Api /* * Execute executes the request */ -func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/pet/{petId}" @@ -873,18 +916,22 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -895,7 +942,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiUploadFileRequest struct { @@ -915,7 +962,7 @@ func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { return r } -func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { +func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UploadFileExecute(r) } @@ -937,19 +984,21 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadF * Execute executes the request * @return ApiResponse */ -func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/pet/{petId}/uploadImage" @@ -992,18 +1041,22 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1023,7 +1076,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiUploadFileWithRequiredFileRequest struct { @@ -1043,7 +1096,7 @@ func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetad return r } -func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { +func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UploadFileWithRequiredFileExecute(r) } @@ -1065,19 +1118,21 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i * Execute executes the request * @return ApiResponse */ -func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" @@ -1087,7 +1142,8 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredFile == nil { - return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") + executionError.error = "requiredFile is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -1120,18 +1176,22 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -1151,5 +1211,5 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index 685b6ed0fd17..1b66cff42913 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -37,7 +38,7 @@ type StoreApi interface { /* * DeleteOrderExecute executes the request */ - DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) + DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, GenericOpenAPIError) /* * GetInventory Returns pet inventories by status @@ -51,7 +52,7 @@ type StoreApi interface { * GetInventoryExecute executes the request * @return map[string]int32 */ - GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) + GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, GenericOpenAPIError) /* * GetOrderById Find purchase order by ID @@ -66,7 +67,7 @@ type StoreApi interface { * GetOrderByIdExecute executes the request * @return Order */ - GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) + GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, GenericOpenAPIError) /* * PlaceOrder Place an order for a pet @@ -79,7 +80,7 @@ type StoreApi interface { * PlaceOrderExecute executes the request * @return Order */ - PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) + PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, GenericOpenAPIError) } // StoreApiService StoreApi service @@ -92,7 +93,7 @@ type ApiDeleteOrderRequest struct { } -func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.DeleteOrderExecute(r) } @@ -114,18 +115,20 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiD /* * Execute executes the request */ -func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) { +func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/store/order/{order_id}" @@ -154,18 +157,22 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -176,7 +183,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiGetInventoryRequest struct { @@ -185,7 +192,7 @@ type ApiGetInventoryRequest struct { } -func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { +func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.GetInventoryExecute(r) } @@ -206,19 +213,21 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequ * Execute executes the request * @return map[string]int32 */ -func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) { +func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue map[string]int32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/store/inventory" @@ -260,18 +269,22 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -291,7 +304,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiGetOrderByIdRequest struct { @@ -301,7 +314,7 @@ type ApiGetOrderByIdRequest struct { } -func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { +func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.GetOrderByIdExecute(r) } @@ -324,19 +337,21 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiG * Execute executes the request * @return Order */ -func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/store/order/{order_id}" @@ -346,10 +361,12 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.orderId < 1 { - return localVarReturnValue, nil, reportError("orderId must be greater than 1") + executionError.error = "orderId must be greater than 1" + return localVarReturnValue, nil, executionError } if r.orderId > 5 { - return localVarReturnValue, nil, reportError("orderId must be less than 5") + executionError.error = "orderId must be less than 5" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -371,18 +388,22 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -402,7 +423,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiPlaceOrderRequest struct { @@ -416,7 +437,7 @@ func (r ApiPlaceOrderRequest) Order(order Order) ApiPlaceOrderRequest { return r } -func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { +func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.PlaceOrderExecute(r) } @@ -436,19 +457,21 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest * Execute executes the request * @return Order */ -func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/store/order" @@ -457,7 +480,8 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.order == nil { - return localVarReturnValue, nil, reportError("order is required and must be specified") + executionError.error = "order is required and must be specified" + return localVarReturnValue, nil, executionError } // to determine the Content-Type header @@ -481,18 +505,22 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarPostBody = r.order req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -512,5 +540,5 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index 7246b5737854..5a23944920e1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -11,6 +11,7 @@ package petstore import ( + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -36,7 +37,7 @@ type UserApi interface { /* * CreateUserExecute executes the request */ - CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) + CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, GenericOpenAPIError) /* * CreateUsersWithArrayInput Creates list of users with given input array @@ -48,7 +49,7 @@ type UserApi interface { /* * CreateUsersWithArrayInputExecute executes the request */ - CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) + CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, GenericOpenAPIError) /* * CreateUsersWithListInput Creates list of users with given input array @@ -60,7 +61,7 @@ type UserApi interface { /* * CreateUsersWithListInputExecute executes the request */ - CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) + CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, GenericOpenAPIError) /* * DeleteUser Delete user @@ -74,7 +75,7 @@ type UserApi interface { /* * DeleteUserExecute executes the request */ - DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) + DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, GenericOpenAPIError) /* * GetUserByName Get user by user name @@ -88,7 +89,7 @@ type UserApi interface { * GetUserByNameExecute executes the request * @return User */ - GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) + GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, GenericOpenAPIError) /* * LoginUser Logs user into the system @@ -101,7 +102,7 @@ type UserApi interface { * LoginUserExecute executes the request * @return string */ - LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) + LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, GenericOpenAPIError) /* * LogoutUser Logs out current logged in user session @@ -113,7 +114,7 @@ type UserApi interface { /* * LogoutUserExecute executes the request */ - LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) + LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, GenericOpenAPIError) /* * UpdateUser Updated user @@ -127,7 +128,7 @@ type UserApi interface { /* * UpdateUserExecute executes the request */ - UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) + UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, GenericOpenAPIError) } // UserApiService UserApi service @@ -144,7 +145,7 @@ func (r ApiCreateUserRequest) User(user User) ApiCreateUserRequest { return r } -func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.CreateUserExecute(r) } @@ -164,18 +165,20 @@ func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { /* * Execute executes the request */ -func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user" @@ -184,7 +187,8 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - return nil, reportError("user is required and must be specified") + executionError.error = "user is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -208,18 +212,22 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -230,7 +238,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiCreateUsersWithArrayInputRequest struct { @@ -244,7 +252,7 @@ func (r ApiCreateUsersWithArrayInputRequest) User(user []User) ApiCreateUsersWit return r } -func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.CreateUsersWithArrayInputExecute(r) } @@ -263,18 +271,20 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCrea /* * Execute executes the request */ -func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/createWithArray" @@ -283,7 +293,8 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - return nil, reportError("user is required and must be specified") + executionError.error = "user is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -307,18 +318,22 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -329,7 +344,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiCreateUsersWithListInputRequest struct { @@ -343,7 +358,7 @@ func (r ApiCreateUsersWithListInputRequest) User(user []User) ApiCreateUsersWith return r } -func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.CreateUsersWithListInputExecute(r) } @@ -362,18 +377,20 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreat /* * Execute executes the request */ -func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/createWithList" @@ -382,7 +399,8 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - return nil, reportError("user is required and must be specified") + executionError.error = "user is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -406,18 +424,22 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -428,7 +450,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiDeleteUserRequest struct { @@ -438,7 +460,7 @@ type ApiDeleteUserRequest struct { } -func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.DeleteUserExecute(r) } @@ -460,18 +482,20 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDe /* * Execute executes the request */ -func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/{username}" @@ -500,18 +524,22 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -522,7 +550,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiGetUserByNameRequest struct { @@ -532,7 +560,7 @@ type ApiGetUserByNameRequest struct { } -func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { +func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.GetUserByNameExecute(r) } @@ -554,19 +582,21 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) Ap * Execute executes the request * @return User */ -func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) { +func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/user/{username}" @@ -595,18 +625,22 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -626,7 +660,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiLoginUserRequest struct { @@ -645,7 +679,7 @@ func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { return r } -func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, GenericOpenAPIError) { return r.ApiService.LoginUserExecute(r) } @@ -665,19 +699,21 @@ func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { * Execute executes the request * @return string */ -func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) { +func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return localVarReturnValue, nil, executionError} } localVarPath := localBasePath + "/user/login" @@ -686,10 +722,12 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.username == nil { - return localVarReturnValue, nil, reportError("username is required and must be specified") + executionError.error = "username is required and must be specified" + return localVarReturnValue, nil, executionError } if r.password == nil { - return localVarReturnValue, nil, reportError("password is required and must be specified") + executionError.error = "password is required and must be specified" + return localVarReturnValue, nil, executionError } localVarQueryParams.Add("username", parameterToString(*r.username, "")) @@ -713,18 +751,22 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + executionError.error = err.Error() + return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + executionError.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -744,7 +786,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, executionError } type ApiLogoutUserRequest struct { @@ -753,7 +795,7 @@ type ApiLogoutUserRequest struct { } -func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.LogoutUserExecute(r) } @@ -772,18 +814,20 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { /* * Execute executes the request */ -func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/logout" @@ -811,18 +855,22 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -833,7 +881,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } type ApiUpdateUserRequest struct { @@ -848,7 +896,7 @@ func (r ApiUpdateUserRequest) User(user User) ApiUpdateUserRequest { return r } -func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, GenericOpenAPIError) { return r.ApiService.UpdateUserExecute(r) } @@ -870,18 +918,20 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUp /* * Execute executes the request */ -func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, GenericOpenAPIError) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + executionError.error = err.Error() + return nil, executionError} } localVarPath := localBasePath + "/user/{username}" @@ -891,7 +941,8 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - return nil, reportError("user is required and must be specified") + executionError.error = "user is required and must be specified" + return nil, executionError } // to determine the Content-Type header @@ -915,18 +966,22 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + executionError.error = err.Error() + return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + executionError.error = err.Error() + return localVarHTTPResponse, executionError } if localVarHTTPResponse.StatusCode >= 300 { @@ -937,5 +992,5 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re return localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarHTTPResponse, executionError } From 2c6310ebc0d5a3f423433144ccc9dfba97b2b842 Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Wed, 9 Dec 2020 14:00:49 +0530 Subject: [PATCH 02/11] reformatted files --- .../src/main/resources/go/api.mustache | 36 +-- .../go/go-petstore/api_another_fake.go | 16 +- .../petstore/go/go-petstore/api_fake.go | 222 +++++++++--------- .../go-petstore/api_fake_classname_tags123.go | 16 +- .../client/petstore/go/go-petstore/api_pet.go | 120 +++++----- .../petstore/go/go-petstore/api_store.go | 58 ++--- .../petstore/go/go-petstore/api_user.go | 110 ++++----- .../go-experimental/api_usage.go | 50 ++-- .../go/go-petstore/api_another_fake.go | 16 +- .../petstore/go/go-petstore/api_default.go | 14 +- .../petstore/go/go-petstore/api_fake.go | 220 ++++++++--------- .../go-petstore/api_fake_classname_tags123.go | 16 +- .../client/petstore/go/go-petstore/api_pet.go | 120 +++++----- .../petstore/go/go-petstore/api_store.go | 58 ++--- .../petstore/go/go-petstore/api_user.go | 110 ++++----- 15 files changed, 591 insertions(+), 591 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 975d3983abd1..16a210926fa0 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -3,7 +3,7 @@ package {{packageName}} {{#operations}} import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -93,7 +93,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError {{#returnType}} localVarReturnValue {{{.}}} {{/returnType}} @@ -101,7 +101,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError} } @@ -115,32 +115,32 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{#required}} {{^isPathParam}} if r.{{paramName}} == nil { - executionError.error = "{{paramName}} is required and must be specified" + executionError.error = "{{paramName}} is required and must be specified" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/isPathParam}} {{#minItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minItems}} { - executionError.error = "{{paramName}} must have at least {{minItems}} elements" + executionError.error = "{{paramName}} must have at least {{minItems}} elements" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minItems}} {{#maxItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxItems}} { - executionError.error = "{{paramName}} must have less than {{maxItems}} elements" + executionError.error = "{{paramName}} must have less than {{maxItems}} elements" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maxItems}} {{#minLength}} if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minLength}} { - executionError.error = "{{paramName}} must have at least {{minLength}} elements" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must have at least {{minLength}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minLength}} {{#maxLength}} if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxLength}} { - executionError.error = "{{paramName}} must have less than {{maxLength}} elements" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must have less than {{maxLength}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maxLength}} {{#minimum}} @@ -151,8 +151,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{^isString}} if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} < {{minimum}} { {{/isString}} - executionError.error = "{{paramName}} must be greater than {{minimum}}" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must be greater than {{minimum}}" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minimum}} {{#maximum}} @@ -163,7 +163,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{^isString}} if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} > {{maximum}} { {{/isString}} - executionError.error = "{{paramName}} must be less than {{maximum}}" + executionError.error = "{{paramName}} must be less than {{maximum}}" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maximum}} @@ -267,7 +267,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class if r.{{paramName}} != nil { paramJson, err := parameterToJson(*r.{{paramName}}) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarFormParams.Add("{{baseName}}", paramJson) @@ -323,21 +323,21 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{/authMethods}} req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index 0829cdf0d354..85eb8c47fa48 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -82,13 +82,13 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -123,21 +123,21 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 39db3a7d3e49..3fc3f1b47339 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -257,12 +257,12 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -272,7 +272,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.xmlItem == nil { - executionError.error = "xmlItem is required and must be specified" + executionError.error = "xmlItem is required and must be specified" return nil, executionError } @@ -297,21 +297,21 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarPostBody = r.xmlItem req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -365,13 +365,13 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -402,21 +402,21 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -479,13 +479,13 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -516,21 +516,21 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -593,13 +593,13 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue float32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -630,21 +630,21 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -707,13 +707,13 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -744,21 +744,21 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -820,12 +820,12 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -835,7 +835,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -860,21 +860,21 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -931,12 +931,12 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -946,11 +946,11 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.query == nil { - executionError.error = "query is required and must be specified" + executionError.error = "query is required and must be specified" return nil, executionError } if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -976,21 +976,21 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1044,13 +1044,13 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1060,7 +1060,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1085,21 +1085,21 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1229,12 +1229,12 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1244,35 +1244,35 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.number == nil { - executionError.error = "number is required and must be specified" + executionError.error = "number is required and must be specified" return nil, executionError } if *r.number < 32.1 { - executionError.error = "number must be greater than 32.1" - return nil, executionError + executionError.error = "number must be greater than 32.1" + return nil, executionError } if *r.number > 543.2 { - executionError.error = "number must be less than 543.2" + executionError.error = "number must be less than 543.2" return nil, executionError } if r.double == nil { - executionError.error = "double is required and must be specified" + executionError.error = "double is required and must be specified" return nil, executionError } if *r.double < 67.8 { - executionError.error = "double must be greater than 67.8" - return nil, executionError + executionError.error = "double must be greater than 67.8" + return nil, executionError } if *r.double > 123.4 { - executionError.error = "double must be less than 123.4" + executionError.error = "double must be less than 123.4" return nil, executionError } if r.patternWithoutDelimiter == nil { - executionError.error = "patternWithoutDelimiter is required and must be specified" + executionError.error = "patternWithoutDelimiter is required and must be specified" return nil, executionError } if r.byte_ == nil { - executionError.error = "byte_ is required and must be specified" + executionError.error = "byte_ is required and must be specified" return nil, executionError } @@ -1337,21 +1337,21 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1439,12 +1439,12 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1497,21 +1497,21 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1589,12 +1589,12 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1604,15 +1604,15 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredStringGroup == nil { - executionError.error = "requiredStringGroup is required and must be specified" + executionError.error = "requiredStringGroup is required and must be specified" return nil, executionError } if r.requiredBooleanGroup == nil { - executionError.error = "requiredBooleanGroup is required and must be specified" + executionError.error = "requiredBooleanGroup is required and must be specified" return nil, executionError } if r.requiredInt64Group == nil { - executionError.error = "requiredInt64Group is required and must be specified" + executionError.error = "requiredInt64Group is required and must be specified" return nil, executionError } @@ -1647,21 +1647,21 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1713,12 +1713,12 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1728,7 +1728,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } @@ -1753,21 +1753,21 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarPostBody = r.param req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1824,12 +1824,12 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1839,11 +1839,11 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } if r.param2 == nil { - executionError.error = "param2 is required and must be specified" + executionError.error = "param2 is required and must be specified" return nil, executionError } @@ -1868,21 +1868,21 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormParams.Add("param2", parameterToString(*r.param2, "")) req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1955,12 +1955,12 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1970,23 +1970,23 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pipe == nil { - executionError.error = "pipe is required and must be specified" + executionError.error = "pipe is required and must be specified" return nil, executionError } if r.ioutil == nil { - executionError.error = "ioutil is required and must be specified" + executionError.error = "ioutil is required and must be specified" return nil, executionError } if r.http == nil { - executionError.error = "http is required and must be specified" + executionError.error = "http is required and must be specified" return nil, executionError } if r.url == nil { - executionError.error = "url is required and must be specified" + executionError.error = "url is required and must be specified" return nil, executionError } if r.context == nil { - executionError.error = "context is required and must be specified" + executionError.error = "context is required and must be specified" return nil, executionError } @@ -2024,21 +2024,21 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index cd09afa06a86..c33ba3c5d8d5 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -82,13 +82,13 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -137,21 +137,21 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index a71a262c6707..75a31aa05c11 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -189,12 +189,12 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -204,7 +204,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -229,21 +229,21 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -298,12 +298,12 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -336,21 +336,21 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -404,13 +404,13 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -420,7 +420,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.status == nil { - executionError.error = "status is required and must be specified" + executionError.error = "status is required and must be specified" return localVarReturnValue, nil, executionError } @@ -444,21 +444,21 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -521,13 +521,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -537,7 +537,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.tags == nil { - executionError.error = "tags is required and must be specified" + executionError.error = "tags is required and must be specified" return localVarReturnValue, nil, executionError } @@ -561,21 +561,21 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -636,13 +636,13 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -686,21 +686,21 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -761,12 +761,12 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -776,7 +776,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -801,21 +801,21 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -875,12 +875,12 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -916,21 +916,21 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -991,13 +991,13 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1041,21 +1041,21 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1125,13 +1125,13 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1142,7 +1142,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredFile == nil { - executionError.error = "requiredFile is required and must be specified" + executionError.error = "requiredFile is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1176,21 +1176,21 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index e0281ced9743..82efdce7f506 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -122,12 +122,12 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -157,21 +157,21 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -220,13 +220,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]int32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -269,21 +269,21 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -344,13 +344,13 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -361,11 +361,11 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.orderId < 1 { - executionError.error = "orderId must be greater than 1" - return localVarReturnValue, nil, executionError + executionError.error = "orderId must be greater than 1" + return localVarReturnValue, nil, executionError } if r.orderId > 5 { - executionError.error = "orderId must be less than 5" + executionError.error = "orderId must be less than 5" return localVarReturnValue, nil, executionError } @@ -388,21 +388,21 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -464,13 +464,13 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -480,7 +480,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -505,21 +505,21 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index b74528003901..72e3267ece57 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -172,12 +172,12 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -187,7 +187,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -212,21 +212,21 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -278,12 +278,12 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -293,7 +293,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -318,21 +318,21 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -384,12 +384,12 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -399,7 +399,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -424,21 +424,21 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -489,12 +489,12 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -524,21 +524,21 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -589,13 +589,13 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -625,21 +625,21 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -706,13 +706,13 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -722,11 +722,11 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.username == nil { - executionError.error = "username is required and must be specified" + executionError.error = "username is required and must be specified" return localVarReturnValue, nil, executionError } if r.password == nil { - executionError.error = "password is required and must be specified" + executionError.error = "password is required and must be specified" return localVarReturnValue, nil, executionError } @@ -751,21 +751,21 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -821,12 +821,12 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -855,21 +855,21 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -925,12 +925,12 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -941,7 +941,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -966,21 +966,21 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index 0037af7d3d60..156ef0e0ef1b 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -11,7 +11,7 @@ package x_auth_id_alias import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -60,13 +60,13 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.AnyKey") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -123,21 +123,21 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -195,13 +195,13 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.BothKeys") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -258,21 +258,21 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -330,13 +330,13 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInHeader") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -379,21 +379,21 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -451,13 +451,13 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInQuery") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -500,21 +500,21 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index 48f71466db44..845da0035695 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -82,13 +82,13 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -123,21 +123,21 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarPostBody = r.client req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index f0a805a01a4a..e995d28d3129 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -75,13 +75,13 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue InlineResponseDefault ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -110,21 +110,21 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 44169787df45..11403c52ab5c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -253,13 +253,13 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue HealthCheckResult ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeHealthGet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -288,21 +288,21 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -365,13 +365,13 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -402,21 +402,21 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -479,13 +479,13 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -516,21 +516,21 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarPostBody = r.outerComposite req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -593,13 +593,13 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue float32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -630,21 +630,21 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -707,13 +707,13 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -744,21 +744,21 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -820,12 +820,12 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -835,7 +835,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.fileSchemaTestClass == nil { - executionError.error = "fileSchemaTestClass is required and must be specified" + executionError.error = "fileSchemaTestClass is required and must be specified" return nil, executionError } @@ -860,21 +860,21 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarPostBody = r.fileSchemaTestClass req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -931,12 +931,12 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -946,11 +946,11 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.query == nil { - executionError.error = "query is required and must be specified" + executionError.error = "query is required and must be specified" return nil, executionError } if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -976,21 +976,21 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1044,13 +1044,13 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1060,7 +1060,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1085,21 +1085,21 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarPostBody = r.client req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1230,12 +1230,12 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1245,35 +1245,35 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.number == nil { - executionError.error = "number is required and must be specified" + executionError.error = "number is required and must be specified" return nil, executionError } if *r.number < 32.1 { - executionError.error = "number must be greater than 32.1" - return nil, executionError + executionError.error = "number must be greater than 32.1" + return nil, executionError } if *r.number > 543.2 { - executionError.error = "number must be less than 543.2" + executionError.error = "number must be less than 543.2" return nil, executionError } if r.double == nil { - executionError.error = "double is required and must be specified" + executionError.error = "double is required and must be specified" return nil, executionError } if *r.double < 67.8 { - executionError.error = "double must be greater than 67.8" - return nil, executionError + executionError.error = "double must be greater than 67.8" + return nil, executionError } if *r.double > 123.4 { - executionError.error = "double must be less than 123.4" + executionError.error = "double must be less than 123.4" return nil, executionError } if r.patternWithoutDelimiter == nil { - executionError.error = "patternWithoutDelimiter is required and must be specified" + executionError.error = "patternWithoutDelimiter is required and must be specified" return nil, executionError } if r.byte_ == nil { - executionError.error = "byte_ is required and must be specified" + executionError.error = "byte_ is required and must be specified" return nil, executionError } @@ -1338,21 +1338,21 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1440,12 +1440,12 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1506,21 +1506,21 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1598,12 +1598,12 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1613,15 +1613,15 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredStringGroup == nil { - executionError.error = "requiredStringGroup is required and must be specified" + executionError.error = "requiredStringGroup is required and must be specified" return nil, executionError } if r.requiredBooleanGroup == nil { - executionError.error = "requiredBooleanGroup is required and must be specified" + executionError.error = "requiredBooleanGroup is required and must be specified" return nil, executionError } if r.requiredInt64Group == nil { - executionError.error = "requiredInt64Group is required and must be specified" + executionError.error = "requiredInt64Group is required and must be specified" return nil, executionError } @@ -1656,21 +1656,21 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1722,12 +1722,12 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1737,7 +1737,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requestBody == nil { - executionError.error = "requestBody is required and must be specified" + executionError.error = "requestBody is required and must be specified" return nil, executionError } @@ -1762,21 +1762,21 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarPostBody = r.requestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1833,12 +1833,12 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1848,11 +1848,11 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } if r.param2 == nil { - executionError.error = "param2 is required and must be specified" + executionError.error = "param2 is required and must be specified" return nil, executionError } @@ -1877,21 +1877,21 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormParams.Add("param2", parameterToString(*r.param2, "")) req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1964,12 +1964,12 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1979,23 +1979,23 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pipe == nil { - executionError.error = "pipe is required and must be specified" + executionError.error = "pipe is required and must be specified" return nil, executionError } if r.ioutil == nil { - executionError.error = "ioutil is required and must be specified" + executionError.error = "ioutil is required and must be specified" return nil, executionError } if r.http == nil { - executionError.error = "http is required and must be specified" + executionError.error = "http is required and must be specified" return nil, executionError } if r.url == nil { - executionError.error = "url is required and must be specified" + executionError.error = "url is required and must be specified" return nil, executionError } if r.context == nil { - executionError.error = "context is required and must be specified" + executionError.error = "context is required and must be specified" return nil, executionError } @@ -2043,21 +2043,21 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index bf7c035e49a3..dc9ffcccd842 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -82,13 +82,13 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -137,21 +137,21 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index e48a02897c01..b5f285eddf95 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -189,12 +189,12 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -204,7 +204,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pet == nil { - executionError.error = "pet is required and must be specified" + executionError.error = "pet is required and must be specified" return nil, executionError } @@ -229,21 +229,21 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarPostBody = r.pet req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -298,12 +298,12 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -336,21 +336,21 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -404,13 +404,13 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -420,7 +420,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.status == nil { - executionError.error = "status is required and must be specified" + executionError.error = "status is required and must be specified" return localVarReturnValue, nil, executionError } @@ -444,21 +444,21 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -521,13 +521,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -537,7 +537,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.tags == nil { - executionError.error = "tags is required and must be specified" + executionError.error = "tags is required and must be specified" return localVarReturnValue, nil, executionError } @@ -561,21 +561,21 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -636,13 +636,13 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -686,21 +686,21 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -761,12 +761,12 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -776,7 +776,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pet == nil { - executionError.error = "pet is required and must be specified" + executionError.error = "pet is required and must be specified" return nil, executionError } @@ -801,21 +801,21 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarPostBody = r.pet req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -875,12 +875,12 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -916,21 +916,21 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -991,13 +991,13 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1041,21 +1041,21 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1125,13 +1125,13 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1142,7 +1142,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredFile == nil { - executionError.error = "requiredFile is required and must be specified" + executionError.error = "requiredFile is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1176,21 +1176,21 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index 1b66cff42913..b5c1bebab919 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -122,12 +122,12 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -157,21 +157,21 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -220,13 +220,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]int32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -269,21 +269,21 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -344,13 +344,13 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -361,11 +361,11 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.orderId < 1 { - executionError.error = "orderId must be greater than 1" - return localVarReturnValue, nil, executionError + executionError.error = "orderId must be greater than 1" + return localVarReturnValue, nil, executionError } if r.orderId > 5 { - executionError.error = "orderId must be less than 5" + executionError.error = "orderId must be less than 5" return localVarReturnValue, nil, executionError } @@ -388,21 +388,21 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -464,13 +464,13 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -480,7 +480,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.order == nil { - executionError.error = "order is required and must be specified" + executionError.error = "order is required and must be specified" return localVarReturnValue, nil, executionError } @@ -505,21 +505,21 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarPostBody = r.order req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index 5a23944920e1..31867c712166 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -172,12 +172,12 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -187,7 +187,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -212,21 +212,21 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -278,12 +278,12 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -293,7 +293,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -318,21 +318,21 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -384,12 +384,12 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -399,7 +399,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -424,21 +424,21 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -489,12 +489,12 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -524,21 +524,21 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -589,13 +589,13 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -625,21 +625,21 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -706,13 +706,13 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -722,11 +722,11 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.username == nil { - executionError.error = "username is required and must be specified" + executionError.error = "username is required and must be specified" return localVarReturnValue, nil, executionError } if r.password == nil { - executionError.error = "password is required and must be specified" + executionError.error = "password is required and must be specified" return localVarReturnValue, nil, executionError } @@ -751,21 +751,21 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -821,12 +821,12 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -855,21 +855,21 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -925,12 +925,12 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -941,7 +941,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -966,21 +966,21 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } From c90e33fbddbd7027de02e79034aa1edbce75e79a Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Wed, 9 Dec 2020 15:09:28 +0530 Subject: [PATCH 03/11] reformat files --- .../src/main/resources/go/api.mustache | 32 +-- .../go/go-petstore/api_another_fake.go | 12 +- .../petstore/go/go-petstore/api_fake.go | 192 +++++++++--------- .../go-petstore/api_fake_classname_tags123.go | 12 +- .../client/petstore/go/go-petstore/api_pet.go | 100 ++++----- .../petstore/go/go-petstore/api_store.go | 48 ++--- .../petstore/go/go-petstore/api_user.go | 92 ++++----- .../go-experimental/api_usage.go | 40 ++-- .../go/go-petstore/api_another_fake.go | 12 +- .../petstore/go/go-petstore/api_default.go | 10 +- .../petstore/go/go-petstore/api_fake.go | 190 ++++++++--------- .../go-petstore/api_fake_classname_tags123.go | 12 +- .../client/petstore/go/go-petstore/api_pet.go | 100 ++++----- .../petstore/go/go-petstore/api_store.go | 48 ++--- .../petstore/go/go-petstore/api_user.go | 92 ++++----- 15 files changed, 496 insertions(+), 496 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 16a210926fa0..92658f8071e4 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -93,7 +93,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError {{#returnType}} localVarReturnValue {{{.}}} {{/returnType}} @@ -101,7 +101,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError} } @@ -115,32 +115,32 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{#required}} {{^isPathParam}} if r.{{paramName}} == nil { - executionError.error = "{{paramName}} is required and must be specified" + executionError.error = "{{paramName}} is required and must be specified" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/isPathParam}} {{#minItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minItems}} { - executionError.error = "{{paramName}} must have at least {{minItems}} elements" + executionError.error = "{{paramName}} must have at least {{minItems}} elements" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minItems}} {{#maxItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxItems}} { - executionError.error = "{{paramName}} must have less than {{maxItems}} elements" + executionError.error = "{{paramName}} must have less than {{maxItems}} elements" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maxItems}} {{#minLength}} if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minLength}} { - executionError.error = "{{paramName}} must have at least {{minLength}} elements" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must have at least {{minLength}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minLength}} {{#maxLength}} if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxLength}} { - executionError.error = "{{paramName}} must have less than {{maxLength}} elements" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must have less than {{maxLength}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maxLength}} {{#minimum}} @@ -151,8 +151,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{^isString}} if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} < {{minimum}} { {{/isString}} - executionError.error = "{{paramName}} must be greater than {{minimum}}" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must be greater than {{minimum}}" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minimum}} {{#maximum}} @@ -163,7 +163,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{^isString}} if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} > {{maximum}} { {{/isString}} - executionError.error = "{{paramName}} must be less than {{maximum}}" + executionError.error = "{{paramName}} must be less than {{maximum}}" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maximum}} @@ -267,7 +267,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class if r.{{paramName}} != nil { paramJson, err := parameterToJson(*r.{{paramName}}) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarFormParams.Add("{{baseName}}", paramJson) @@ -323,13 +323,13 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{/authMethods}} req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } @@ -337,7 +337,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index 85eb8c47fa48..f879b0d64963 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -82,13 +82,13 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -123,13 +123,13 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -137,7 +137,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 3fc3f1b47339..85a716b9a96a 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -257,12 +257,12 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -272,7 +272,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.xmlItem == nil { - executionError.error = "xmlItem is required and must be specified" + executionError.error = "xmlItem is required and must be specified" return nil, executionError } @@ -297,13 +297,13 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarPostBody = r.xmlItem req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -311,7 +311,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -365,13 +365,13 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -402,13 +402,13 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -416,7 +416,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -479,13 +479,13 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -516,13 +516,13 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -530,7 +530,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -593,13 +593,13 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue float32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -630,13 +630,13 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -644,7 +644,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -707,13 +707,13 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -744,13 +744,13 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -758,7 +758,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -820,12 +820,12 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -835,7 +835,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -860,13 +860,13 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -874,7 +874,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -931,12 +931,12 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -946,11 +946,11 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.query == nil { - executionError.error = "query is required and must be specified" + executionError.error = "query is required and must be specified" return nil, executionError } if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -976,13 +976,13 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -990,7 +990,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1044,13 +1044,13 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1060,7 +1060,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1085,13 +1085,13 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1099,7 +1099,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1229,12 +1229,12 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1244,35 +1244,35 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.number == nil { - executionError.error = "number is required and must be specified" + executionError.error = "number is required and must be specified" return nil, executionError } if *r.number < 32.1 { - executionError.error = "number must be greater than 32.1" - return nil, executionError + executionError.error = "number must be greater than 32.1" + return nil, executionError } if *r.number > 543.2 { - executionError.error = "number must be less than 543.2" + executionError.error = "number must be less than 543.2" return nil, executionError } if r.double == nil { - executionError.error = "double is required and must be specified" + executionError.error = "double is required and must be specified" return nil, executionError } if *r.double < 67.8 { - executionError.error = "double must be greater than 67.8" - return nil, executionError + executionError.error = "double must be greater than 67.8" + return nil, executionError } if *r.double > 123.4 { - executionError.error = "double must be less than 123.4" + executionError.error = "double must be less than 123.4" return nil, executionError } if r.patternWithoutDelimiter == nil { - executionError.error = "patternWithoutDelimiter is required and must be specified" + executionError.error = "patternWithoutDelimiter is required and must be specified" return nil, executionError } if r.byte_ == nil { - executionError.error = "byte_ is required and must be specified" + executionError.error = "byte_ is required and must be specified" return nil, executionError } @@ -1337,13 +1337,13 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1351,7 +1351,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1439,12 +1439,12 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1497,13 +1497,13 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1511,7 +1511,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1589,12 +1589,12 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1604,15 +1604,15 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredStringGroup == nil { - executionError.error = "requiredStringGroup is required and must be specified" + executionError.error = "requiredStringGroup is required and must be specified" return nil, executionError } if r.requiredBooleanGroup == nil { - executionError.error = "requiredBooleanGroup is required and must be specified" + executionError.error = "requiredBooleanGroup is required and must be specified" return nil, executionError } if r.requiredInt64Group == nil { - executionError.error = "requiredInt64Group is required and must be specified" + executionError.error = "requiredInt64Group is required and must be specified" return nil, executionError } @@ -1647,13 +1647,13 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1661,7 +1661,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1713,12 +1713,12 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1728,7 +1728,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } @@ -1753,13 +1753,13 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarPostBody = r.param req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1767,7 +1767,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1824,12 +1824,12 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1839,11 +1839,11 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } if r.param2 == nil { - executionError.error = "param2 is required and must be specified" + executionError.error = "param2 is required and must be specified" return nil, executionError } @@ -1868,13 +1868,13 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormParams.Add("param2", parameterToString(*r.param2, "")) req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1882,7 +1882,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1955,12 +1955,12 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1970,23 +1970,23 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pipe == nil { - executionError.error = "pipe is required and must be specified" + executionError.error = "pipe is required and must be specified" return nil, executionError } if r.ioutil == nil { - executionError.error = "ioutil is required and must be specified" + executionError.error = "ioutil is required and must be specified" return nil, executionError } if r.http == nil { - executionError.error = "http is required and must be specified" + executionError.error = "http is required and must be specified" return nil, executionError } if r.url == nil { - executionError.error = "url is required and must be specified" + executionError.error = "url is required and must be specified" return nil, executionError } if r.context == nil { - executionError.error = "context is required and must be specified" + executionError.error = "context is required and must be specified" return nil, executionError } @@ -2024,13 +2024,13 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -2038,7 +2038,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index c33ba3c5d8d5..2ae1cbb7dfa9 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -82,13 +82,13 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -137,13 +137,13 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -151,7 +151,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index 75a31aa05c11..53ac0c50e0c7 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -189,12 +189,12 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -204,7 +204,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -229,13 +229,13 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -243,7 +243,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -298,12 +298,12 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -336,13 +336,13 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -350,7 +350,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -404,13 +404,13 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -420,7 +420,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.status == nil { - executionError.error = "status is required and must be specified" + executionError.error = "status is required and must be specified" return localVarReturnValue, nil, executionError } @@ -444,13 +444,13 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -458,7 +458,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -521,13 +521,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -537,7 +537,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.tags == nil { - executionError.error = "tags is required and must be specified" + executionError.error = "tags is required and must be specified" return localVarReturnValue, nil, executionError } @@ -561,13 +561,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -575,7 +575,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -636,13 +636,13 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -686,13 +686,13 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -700,7 +700,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -761,12 +761,12 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -776,7 +776,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -801,13 +801,13 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -815,7 +815,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -875,12 +875,12 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -916,13 +916,13 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -930,7 +930,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -991,13 +991,13 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1041,13 +1041,13 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1055,7 +1055,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1125,13 +1125,13 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1142,7 +1142,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredFile == nil { - executionError.error = "requiredFile is required and must be specified" + executionError.error = "requiredFile is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1176,13 +1176,13 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1190,7 +1190,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 82efdce7f506..6929e81a9ce6 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -122,12 +122,12 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -157,13 +157,13 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -171,7 +171,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -220,13 +220,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]int32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -269,13 +269,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -283,7 +283,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -344,13 +344,13 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -361,11 +361,11 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.orderId < 1 { - executionError.error = "orderId must be greater than 1" - return localVarReturnValue, nil, executionError + executionError.error = "orderId must be greater than 1" + return localVarReturnValue, nil, executionError } if r.orderId > 5 { - executionError.error = "orderId must be less than 5" + executionError.error = "orderId must be less than 5" return localVarReturnValue, nil, executionError } @@ -388,13 +388,13 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -402,7 +402,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -464,13 +464,13 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -480,7 +480,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -505,13 +505,13 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -519,7 +519,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 72e3267ece57..78026428418e 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -172,12 +172,12 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -187,7 +187,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -212,13 +212,13 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -226,7 +226,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -278,12 +278,12 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -293,7 +293,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -318,13 +318,13 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -332,7 +332,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -384,12 +384,12 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -399,7 +399,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -424,13 +424,13 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -438,7 +438,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -489,12 +489,12 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -524,13 +524,13 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -538,7 +538,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -589,13 +589,13 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -625,13 +625,13 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -639,7 +639,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -706,13 +706,13 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -722,11 +722,11 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.username == nil { - executionError.error = "username is required and must be specified" + executionError.error = "username is required and must be specified" return localVarReturnValue, nil, executionError } if r.password == nil { - executionError.error = "password is required and must be specified" + executionError.error = "password is required and must be specified" return localVarReturnValue, nil, executionError } @@ -751,13 +751,13 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -765,7 +765,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -821,12 +821,12 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -855,13 +855,13 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -869,7 +869,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -925,12 +925,12 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -941,7 +941,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -966,13 +966,13 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -980,7 +980,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index 156ef0e0ef1b..8bf7e4a0df43 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -60,13 +60,13 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.AnyKey") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -123,13 +123,13 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -137,7 +137,7 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -195,13 +195,13 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.BothKeys") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -258,13 +258,13 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -272,7 +272,7 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -330,13 +330,13 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInHeader") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -379,13 +379,13 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -393,7 +393,7 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -451,13 +451,13 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInQuery") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -500,13 +500,13 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -514,7 +514,7 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index 845da0035695..702e5bacff6c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -82,13 +82,13 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -123,13 +123,13 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarPostBody = r.client req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -137,7 +137,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index e995d28d3129..40d972c86aa1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -75,13 +75,13 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue InlineResponseDefault ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -110,13 +110,13 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -124,7 +124,7 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 11403c52ab5c..85b861e92eb0 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -253,13 +253,13 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue HealthCheckResult ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeHealthGet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -288,13 +288,13 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -302,7 +302,7 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -365,13 +365,13 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -402,13 +402,13 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -416,7 +416,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -479,13 +479,13 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -516,13 +516,13 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarPostBody = r.outerComposite req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -530,7 +530,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -593,13 +593,13 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue float32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -630,13 +630,13 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -644,7 +644,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -707,13 +707,13 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -744,13 +744,13 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -758,7 +758,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -820,12 +820,12 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -835,7 +835,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.fileSchemaTestClass == nil { - executionError.error = "fileSchemaTestClass is required and must be specified" + executionError.error = "fileSchemaTestClass is required and must be specified" return nil, executionError } @@ -860,13 +860,13 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarPostBody = r.fileSchemaTestClass req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -874,7 +874,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -931,12 +931,12 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -946,11 +946,11 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.query == nil { - executionError.error = "query is required and must be specified" + executionError.error = "query is required and must be specified" return nil, executionError } if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -976,13 +976,13 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -990,7 +990,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1044,13 +1044,13 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1060,7 +1060,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1085,13 +1085,13 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarPostBody = r.client req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1099,7 +1099,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1230,12 +1230,12 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1245,35 +1245,35 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.number == nil { - executionError.error = "number is required and must be specified" + executionError.error = "number is required and must be specified" return nil, executionError } if *r.number < 32.1 { - executionError.error = "number must be greater than 32.1" - return nil, executionError + executionError.error = "number must be greater than 32.1" + return nil, executionError } if *r.number > 543.2 { - executionError.error = "number must be less than 543.2" + executionError.error = "number must be less than 543.2" return nil, executionError } if r.double == nil { - executionError.error = "double is required and must be specified" + executionError.error = "double is required and must be specified" return nil, executionError } if *r.double < 67.8 { - executionError.error = "double must be greater than 67.8" - return nil, executionError + executionError.error = "double must be greater than 67.8" + return nil, executionError } if *r.double > 123.4 { - executionError.error = "double must be less than 123.4" + executionError.error = "double must be less than 123.4" return nil, executionError } if r.patternWithoutDelimiter == nil { - executionError.error = "patternWithoutDelimiter is required and must be specified" + executionError.error = "patternWithoutDelimiter is required and must be specified" return nil, executionError } if r.byte_ == nil { - executionError.error = "byte_ is required and must be specified" + executionError.error = "byte_ is required and must be specified" return nil, executionError } @@ -1338,13 +1338,13 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1352,7 +1352,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1440,12 +1440,12 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1506,13 +1506,13 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1520,7 +1520,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1598,12 +1598,12 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1613,15 +1613,15 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredStringGroup == nil { - executionError.error = "requiredStringGroup is required and must be specified" + executionError.error = "requiredStringGroup is required and must be specified" return nil, executionError } if r.requiredBooleanGroup == nil { - executionError.error = "requiredBooleanGroup is required and must be specified" + executionError.error = "requiredBooleanGroup is required and must be specified" return nil, executionError } if r.requiredInt64Group == nil { - executionError.error = "requiredInt64Group is required and must be specified" + executionError.error = "requiredInt64Group is required and must be specified" return nil, executionError } @@ -1656,13 +1656,13 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1670,7 +1670,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1722,12 +1722,12 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1737,7 +1737,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requestBody == nil { - executionError.error = "requestBody is required and must be specified" + executionError.error = "requestBody is required and must be specified" return nil, executionError } @@ -1762,13 +1762,13 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarPostBody = r.requestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1776,7 +1776,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1833,12 +1833,12 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1848,11 +1848,11 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } if r.param2 == nil { - executionError.error = "param2 is required and must be specified" + executionError.error = "param2 is required and must be specified" return nil, executionError } @@ -1877,13 +1877,13 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormParams.Add("param2", parameterToString(*r.param2, "")) req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1891,7 +1891,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1964,12 +1964,12 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1979,23 +1979,23 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pipe == nil { - executionError.error = "pipe is required and must be specified" + executionError.error = "pipe is required and must be specified" return nil, executionError } if r.ioutil == nil { - executionError.error = "ioutil is required and must be specified" + executionError.error = "ioutil is required and must be specified" return nil, executionError } if r.http == nil { - executionError.error = "http is required and must be specified" + executionError.error = "http is required and must be specified" return nil, executionError } if r.url == nil { - executionError.error = "url is required and must be specified" + executionError.error = "url is required and must be specified" return nil, executionError } if r.context == nil { - executionError.error = "context is required and must be specified" + executionError.error = "context is required and must be specified" return nil, executionError } @@ -2043,13 +2043,13 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -2057,7 +2057,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index dc9ffcccd842..1a29b774b9d8 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -82,13 +82,13 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -137,13 +137,13 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -151,7 +151,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index b5f285eddf95..203892419ee6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -189,12 +189,12 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -204,7 +204,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pet == nil { - executionError.error = "pet is required and must be specified" + executionError.error = "pet is required and must be specified" return nil, executionError } @@ -229,13 +229,13 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarPostBody = r.pet req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -243,7 +243,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -298,12 +298,12 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -336,13 +336,13 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -350,7 +350,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -404,13 +404,13 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -420,7 +420,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.status == nil { - executionError.error = "status is required and must be specified" + executionError.error = "status is required and must be specified" return localVarReturnValue, nil, executionError } @@ -444,13 +444,13 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -458,7 +458,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -521,13 +521,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -537,7 +537,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.tags == nil { - executionError.error = "tags is required and must be specified" + executionError.error = "tags is required and must be specified" return localVarReturnValue, nil, executionError } @@ -561,13 +561,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -575,7 +575,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -636,13 +636,13 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -686,13 +686,13 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -700,7 +700,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -761,12 +761,12 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -776,7 +776,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pet == nil { - executionError.error = "pet is required and must be specified" + executionError.error = "pet is required and must be specified" return nil, executionError } @@ -801,13 +801,13 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarPostBody = r.pet req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -815,7 +815,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -875,12 +875,12 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -916,13 +916,13 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -930,7 +930,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -991,13 +991,13 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1041,13 +1041,13 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1055,7 +1055,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1125,13 +1125,13 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1142,7 +1142,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredFile == nil { - executionError.error = "requiredFile is required and must be specified" + executionError.error = "requiredFile is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1176,13 +1176,13 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1190,7 +1190,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index b5c1bebab919..e646975b5a2e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -122,12 +122,12 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -157,13 +157,13 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -171,7 +171,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -220,13 +220,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]int32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -269,13 +269,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -283,7 +283,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -344,13 +344,13 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -361,11 +361,11 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.orderId < 1 { - executionError.error = "orderId must be greater than 1" - return localVarReturnValue, nil, executionError + executionError.error = "orderId must be greater than 1" + return localVarReturnValue, nil, executionError } if r.orderId > 5 { - executionError.error = "orderId must be less than 5" + executionError.error = "orderId must be less than 5" return localVarReturnValue, nil, executionError } @@ -388,13 +388,13 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -402,7 +402,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -464,13 +464,13 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -480,7 +480,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.order == nil { - executionError.error = "order is required and must be specified" + executionError.error = "order is required and must be specified" return localVarReturnValue, nil, executionError } @@ -505,13 +505,13 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarPostBody = r.order req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -519,7 +519,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index 31867c712166..6597a0e65a33 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -172,12 +172,12 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -187,7 +187,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -212,13 +212,13 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -226,7 +226,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -278,12 +278,12 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -293,7 +293,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -318,13 +318,13 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -332,7 +332,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -384,12 +384,12 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -399,7 +399,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -424,13 +424,13 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -438,7 +438,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -489,12 +489,12 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -524,13 +524,13 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -538,7 +538,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -589,13 +589,13 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -625,13 +625,13 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -639,7 +639,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -706,13 +706,13 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -722,11 +722,11 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.username == nil { - executionError.error = "username is required and must be specified" + executionError.error = "username is required and must be specified" return localVarReturnValue, nil, executionError } if r.password == nil { - executionError.error = "password is required and must be specified" + executionError.error = "password is required and must be specified" return localVarReturnValue, nil, executionError } @@ -751,13 +751,13 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -765,7 +765,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -821,12 +821,12 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -855,13 +855,13 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -869,7 +869,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -925,12 +925,12 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -941,7 +941,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -966,13 +966,13 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -980,7 +980,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } From e14b2e79d5c2f8a113b7c72337ac0de16246a646 Mon Sep 17 00:00:00 2001 From: Aanisha Mishra Date: Wed, 9 Dec 2020 15:23:38 +0530 Subject: [PATCH 04/11] spaces to tabs --- .../src/main/resources/go/api.mustache | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 92658f8071e4..f168daeaadea 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -3,7 +3,7 @@ package {{packageName}} {{#operations}} import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -93,7 +93,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError {{#returnType}} localVarReturnValue {{{.}}} {{/returnType}} @@ -101,7 +101,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError} } @@ -115,32 +115,32 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{#required}} {{^isPathParam}} if r.{{paramName}} == nil { - executionError.error = "{{paramName}} is required and must be specified" + executionError.error = "{{paramName}} is required and must be specified" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/isPathParam}} {{#minItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minItems}} { - executionError.error = "{{paramName}} must have at least {{minItems}} elements" + executionError.error = "{{paramName}} must have at least {{minItems}} elements" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minItems}} {{#maxItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxItems}} { - executionError.error = "{{paramName}} must have less than {{maxItems}} elements" + executionError.error = "{{paramName}} must have less than {{maxItems}} elements" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maxItems}} {{#minLength}} if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minLength}} { - executionError.error = "{{paramName}} must have at least {{minLength}} elements" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must have at least {{minLength}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minLength}} {{#maxLength}} if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxLength}} { - executionError.error = "{{paramName}} must have less than {{maxLength}} elements" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must have less than {{maxLength}} elements" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maxLength}} {{#minimum}} @@ -151,8 +151,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{^isString}} if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} < {{minimum}} { {{/isString}} - executionError.error = "{{paramName}} must be greater than {{minimum}}" - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError + executionError.error = "{{paramName}} must be greater than {{minimum}}" + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/minimum}} {{#maximum}} @@ -163,7 +163,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{^isString}} if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} > {{maximum}} { {{/isString}} - executionError.error = "{{paramName}} must be less than {{maximum}}" + executionError.error = "{{paramName}} must be less than {{maximum}}" return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } {{/maximum}} @@ -267,7 +267,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class if r.{{paramName}} != nil { paramJson, err := parameterToJson(*r.{{paramName}}) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarFormParams.Add("{{baseName}}", paramJson) @@ -323,21 +323,21 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{/authMethods}} req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, executionError } From 0896d691eca868541209c0bcf510dabf254d8203 Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Wed, 9 Dec 2020 15:26:12 +0530 Subject: [PATCH 05/11] update petstore examples --- .../go/go-petstore/api_another_fake.go | 16 +- .../petstore/go/go-petstore/api_fake.go | 222 +++++++++--------- .../go-petstore/api_fake_classname_tags123.go | 16 +- .../client/petstore/go/go-petstore/api_pet.go | 120 +++++----- .../petstore/go/go-petstore/api_store.go | 58 ++--- .../petstore/go/go-petstore/api_user.go | 110 ++++----- .../go-experimental/api_usage.go | 50 ++-- .../go/go-petstore/api_another_fake.go | 16 +- .../petstore/go/go-petstore/api_default.go | 14 +- .../petstore/go/go-petstore/api_fake.go | 220 ++++++++--------- .../go-petstore/api_fake_classname_tags123.go | 16 +- .../client/petstore/go/go-petstore/api_pet.go | 120 +++++----- .../petstore/go/go-petstore/api_store.go | 58 ++--- .../petstore/go/go-petstore/api_user.go | 110 ++++----- 14 files changed, 573 insertions(+), 573 deletions(-) diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index f879b0d64963..954850f10ff9 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -82,13 +82,13 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -123,21 +123,21 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 85a716b9a96a..c2a68fa8db34 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -257,12 +257,12 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -272,7 +272,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.xmlItem == nil { - executionError.error = "xmlItem is required and must be specified" + executionError.error = "xmlItem is required and must be specified" return nil, executionError } @@ -297,21 +297,21 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localVarPostBody = r.xmlItem req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -365,13 +365,13 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -402,21 +402,21 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -479,13 +479,13 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -516,21 +516,21 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -593,13 +593,13 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue float32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -630,21 +630,21 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -707,13 +707,13 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -744,21 +744,21 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -820,12 +820,12 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -835,7 +835,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -860,21 +860,21 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -931,12 +931,12 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -946,11 +946,11 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.query == nil { - executionError.error = "query is required and must be specified" + executionError.error = "query is required and must be specified" return nil, executionError } if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -976,21 +976,21 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1044,13 +1044,13 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1060,7 +1060,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1085,21 +1085,21 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1229,12 +1229,12 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1244,35 +1244,35 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.number == nil { - executionError.error = "number is required and must be specified" + executionError.error = "number is required and must be specified" return nil, executionError } if *r.number < 32.1 { - executionError.error = "number must be greater than 32.1" - return nil, executionError + executionError.error = "number must be greater than 32.1" + return nil, executionError } if *r.number > 543.2 { - executionError.error = "number must be less than 543.2" + executionError.error = "number must be less than 543.2" return nil, executionError } if r.double == nil { - executionError.error = "double is required and must be specified" + executionError.error = "double is required and must be specified" return nil, executionError } if *r.double < 67.8 { - executionError.error = "double must be greater than 67.8" - return nil, executionError + executionError.error = "double must be greater than 67.8" + return nil, executionError } if *r.double > 123.4 { - executionError.error = "double must be less than 123.4" + executionError.error = "double must be less than 123.4" return nil, executionError } if r.patternWithoutDelimiter == nil { - executionError.error = "patternWithoutDelimiter is required and must be specified" + executionError.error = "patternWithoutDelimiter is required and must be specified" return nil, executionError } if r.byte_ == nil { - executionError.error = "byte_ is required and must be specified" + executionError.error = "byte_ is required and must be specified" return nil, executionError } @@ -1337,21 +1337,21 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1439,12 +1439,12 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1497,21 +1497,21 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1589,12 +1589,12 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1604,15 +1604,15 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredStringGroup == nil { - executionError.error = "requiredStringGroup is required and must be specified" + executionError.error = "requiredStringGroup is required and must be specified" return nil, executionError } if r.requiredBooleanGroup == nil { - executionError.error = "requiredBooleanGroup is required and must be specified" + executionError.error = "requiredBooleanGroup is required and must be specified" return nil, executionError } if r.requiredInt64Group == nil { - executionError.error = "requiredInt64Group is required and must be specified" + executionError.error = "requiredInt64Group is required and must be specified" return nil, executionError } @@ -1647,21 +1647,21 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1713,12 +1713,12 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1728,7 +1728,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } @@ -1753,21 +1753,21 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarPostBody = r.param req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1824,12 +1824,12 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1839,11 +1839,11 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } if r.param2 == nil { - executionError.error = "param2 is required and must be specified" + executionError.error = "param2 is required and must be specified" return nil, executionError } @@ -1868,21 +1868,21 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormParams.Add("param2", parameterToString(*r.param2, "")) req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1955,12 +1955,12 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1970,23 +1970,23 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pipe == nil { - executionError.error = "pipe is required and must be specified" + executionError.error = "pipe is required and must be specified" return nil, executionError } if r.ioutil == nil { - executionError.error = "ioutil is required and must be specified" + executionError.error = "ioutil is required and must be specified" return nil, executionError } if r.http == nil { - executionError.error = "http is required and must be specified" + executionError.error = "http is required and must be specified" return nil, executionError } if r.url == nil { - executionError.error = "url is required and must be specified" + executionError.error = "url is required and must be specified" return nil, executionError } if r.context == nil { - executionError.error = "context is required and must be specified" + executionError.error = "context is required and must be specified" return nil, executionError } @@ -2024,21 +2024,21 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 2ae1cbb7dfa9..79a80c29e4ea 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -82,13 +82,13 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -137,21 +137,21 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index 53ac0c50e0c7..0e6c2be7f388 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -189,12 +189,12 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -204,7 +204,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -229,21 +229,21 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -298,12 +298,12 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -336,21 +336,21 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -404,13 +404,13 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -420,7 +420,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.status == nil { - executionError.error = "status is required and must be specified" + executionError.error = "status is required and must be specified" return localVarReturnValue, nil, executionError } @@ -444,21 +444,21 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -521,13 +521,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -537,7 +537,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.tags == nil { - executionError.error = "tags is required and must be specified" + executionError.error = "tags is required and must be specified" return localVarReturnValue, nil, executionError } @@ -561,21 +561,21 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -636,13 +636,13 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -686,21 +686,21 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -761,12 +761,12 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -776,7 +776,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -801,21 +801,21 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -875,12 +875,12 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -916,21 +916,21 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -991,13 +991,13 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1041,21 +1041,21 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1125,13 +1125,13 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1142,7 +1142,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredFile == nil { - executionError.error = "requiredFile is required and must be specified" + executionError.error = "requiredFile is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1176,21 +1176,21 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 6929e81a9ce6..5984dc91d771 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -122,12 +122,12 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -157,21 +157,21 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -220,13 +220,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]int32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -269,21 +269,21 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -344,13 +344,13 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -361,11 +361,11 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.orderId < 1 { - executionError.error = "orderId must be greater than 1" - return localVarReturnValue, nil, executionError + executionError.error = "orderId must be greater than 1" + return localVarReturnValue, nil, executionError } if r.orderId > 5 { - executionError.error = "orderId must be less than 5" + executionError.error = "orderId must be less than 5" return localVarReturnValue, nil, executionError } @@ -388,21 +388,21 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -464,13 +464,13 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -480,7 +480,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return localVarReturnValue, nil, executionError } @@ -505,21 +505,21 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 78026428418e..7ad49e656099 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -172,12 +172,12 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -187,7 +187,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -212,21 +212,21 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -278,12 +278,12 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -293,7 +293,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -318,21 +318,21 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -384,12 +384,12 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -399,7 +399,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -424,21 +424,21 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -489,12 +489,12 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -524,21 +524,21 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -589,13 +589,13 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -625,21 +625,21 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -706,13 +706,13 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -722,11 +722,11 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.username == nil { - executionError.error = "username is required and must be specified" + executionError.error = "username is required and must be specified" return localVarReturnValue, nil, executionError } if r.password == nil { - executionError.error = "password is required and must be specified" + executionError.error = "password is required and must be specified" return localVarReturnValue, nil, executionError } @@ -751,21 +751,21 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -821,12 +821,12 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -855,21 +855,21 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -925,12 +925,12 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -941,7 +941,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.body == nil { - executionError.error = "body is required and must be specified" + executionError.error = "body is required and must be specified" return nil, executionError } @@ -966,21 +966,21 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index 8bf7e4a0df43..b1b56d212a04 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -11,7 +11,7 @@ package x_auth_id_alias import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -60,13 +60,13 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.AnyKey") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -123,21 +123,21 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -195,13 +195,13 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.BothKeys") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -258,21 +258,21 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -330,13 +330,13 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInHeader") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -379,21 +379,21 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -451,13 +451,13 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInQuery") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -500,21 +500,21 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index 702e5bacff6c..fa8a8d65e410 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -82,13 +82,13 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -123,21 +123,21 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localVarPostBody = r.client req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index 40d972c86aa1..bf23e98a3b2e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -75,13 +75,13 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue InlineResponseDefault ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -110,21 +110,21 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 85b861e92eb0..65b72570e278 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -253,13 +253,13 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue HealthCheckResult ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeHealthGet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -288,21 +288,21 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -365,13 +365,13 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue bool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -402,21 +402,21 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -479,13 +479,13 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -516,21 +516,21 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localVarPostBody = r.outerComposite req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -593,13 +593,13 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue float32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -630,21 +630,21 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -707,13 +707,13 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -744,21 +744,21 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localVarPostBody = r.body req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -820,12 +820,12 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -835,7 +835,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.fileSchemaTestClass == nil { - executionError.error = "fileSchemaTestClass is required and must be specified" + executionError.error = "fileSchemaTestClass is required and must be specified" return nil, executionError } @@ -860,21 +860,21 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localVarPostBody = r.fileSchemaTestClass req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -931,12 +931,12 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -946,11 +946,11 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.query == nil { - executionError.error = "query is required and must be specified" + executionError.error = "query is required and must be specified" return nil, executionError } if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -976,21 +976,21 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1044,13 +1044,13 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1060,7 +1060,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1085,21 +1085,21 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localVarPostBody = r.client req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1230,12 +1230,12 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1245,35 +1245,35 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.number == nil { - executionError.error = "number is required and must be specified" + executionError.error = "number is required and must be specified" return nil, executionError } if *r.number < 32.1 { - executionError.error = "number must be greater than 32.1" - return nil, executionError + executionError.error = "number must be greater than 32.1" + return nil, executionError } if *r.number > 543.2 { - executionError.error = "number must be less than 543.2" + executionError.error = "number must be less than 543.2" return nil, executionError } if r.double == nil { - executionError.error = "double is required and must be specified" + executionError.error = "double is required and must be specified" return nil, executionError } if *r.double < 67.8 { - executionError.error = "double must be greater than 67.8" - return nil, executionError + executionError.error = "double must be greater than 67.8" + return nil, executionError } if *r.double > 123.4 { - executionError.error = "double must be less than 123.4" + executionError.error = "double must be less than 123.4" return nil, executionError } if r.patternWithoutDelimiter == nil { - executionError.error = "patternWithoutDelimiter is required and must be specified" + executionError.error = "patternWithoutDelimiter is required and must be specified" return nil, executionError } if r.byte_ == nil { - executionError.error = "byte_ is required and must be specified" + executionError.error = "byte_ is required and must be specified" return nil, executionError } @@ -1338,21 +1338,21 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1440,12 +1440,12 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1506,21 +1506,21 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1598,12 +1598,12 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1613,15 +1613,15 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredStringGroup == nil { - executionError.error = "requiredStringGroup is required and must be specified" + executionError.error = "requiredStringGroup is required and must be specified" return nil, executionError } if r.requiredBooleanGroup == nil { - executionError.error = "requiredBooleanGroup is required and must be specified" + executionError.error = "requiredBooleanGroup is required and must be specified" return nil, executionError } if r.requiredInt64Group == nil { - executionError.error = "requiredInt64Group is required and must be specified" + executionError.error = "requiredInt64Group is required and must be specified" return nil, executionError } @@ -1656,21 +1656,21 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1722,12 +1722,12 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1737,7 +1737,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requestBody == nil { - executionError.error = "requestBody is required and must be specified" + executionError.error = "requestBody is required and must be specified" return nil, executionError } @@ -1762,21 +1762,21 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localVarPostBody = r.requestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1833,12 +1833,12 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1848,11 +1848,11 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.param == nil { - executionError.error = "param is required and must be specified" + executionError.error = "param is required and must be specified" return nil, executionError } if r.param2 == nil { - executionError.error = "param2 is required and must be specified" + executionError.error = "param2 is required and must be specified" return nil, executionError } @@ -1877,21 +1877,21 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localVarFormParams.Add("param2", parameterToString(*r.param2, "")) req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -1964,12 +1964,12 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -1979,23 +1979,23 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pipe == nil { - executionError.error = "pipe is required and must be specified" + executionError.error = "pipe is required and must be specified" return nil, executionError } if r.ioutil == nil { - executionError.error = "ioutil is required and must be specified" + executionError.error = "ioutil is required and must be specified" return nil, executionError } if r.http == nil { - executionError.error = "http is required and must be specified" + executionError.error = "http is required and must be specified" return nil, executionError } if r.url == nil { - executionError.error = "url is required and must be specified" + executionError.error = "url is required and must be specified" return nil, executionError } if r.context == nil { - executionError.error = "context is required and must be specified" + executionError.error = "context is required and must be specified" return nil, executionError } @@ -2043,21 +2043,21 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 1a29b774b9d8..82fd15f5405b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -82,13 +82,13 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -98,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.client == nil { - executionError.error = "client is required and must be specified" + executionError.error = "client is required and must be specified" return localVarReturnValue, nil, executionError } @@ -137,21 +137,21 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index 203892419ee6..195195c48e77 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -189,12 +189,12 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -204,7 +204,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pet == nil { - executionError.error = "pet is required and must be specified" + executionError.error = "pet is required and must be specified" return nil, executionError } @@ -229,21 +229,21 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localVarPostBody = r.pet req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -298,12 +298,12 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -336,21 +336,21 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -404,13 +404,13 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -420,7 +420,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.status == nil { - executionError.error = "status is required and must be specified" + executionError.error = "status is required and must be specified" return localVarReturnValue, nil, executionError } @@ -444,21 +444,21 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -521,13 +521,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue []Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -537,7 +537,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.tags == nil { - executionError.error = "tags is required and must be specified" + executionError.error = "tags is required and must be specified" return localVarReturnValue, nil, executionError } @@ -561,21 +561,21 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -636,13 +636,13 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -686,21 +686,21 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -761,12 +761,12 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -776,7 +776,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.pet == nil { - executionError.error = "pet is required and must be specified" + executionError.error = "pet is required and must be specified" return nil, executionError } @@ -801,21 +801,21 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localVarPostBody = r.pet req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -875,12 +875,12 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -916,21 +916,21 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -991,13 +991,13 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1041,21 +1041,21 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -1125,13 +1125,13 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -1142,7 +1142,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.requiredFile == nil { - executionError.error = "requiredFile is required and must be specified" + executionError.error = "requiredFile is required and must be specified" return localVarReturnValue, nil, executionError } @@ -1176,21 +1176,21 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index e646975b5a2e..36b9e2590452 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -122,12 +122,12 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -157,21 +157,21 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -220,13 +220,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue map[string]int32 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -269,21 +269,21 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -344,13 +344,13 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -361,11 +361,11 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.orderId < 1 { - executionError.error = "orderId must be greater than 1" - return localVarReturnValue, nil, executionError + executionError.error = "orderId must be greater than 1" + return localVarReturnValue, nil, executionError } if r.orderId > 5 { - executionError.error = "orderId must be less than 5" + executionError.error = "orderId must be less than 5" return localVarReturnValue, nil, executionError } @@ -388,21 +388,21 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -464,13 +464,13 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -480,7 +480,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.order == nil { - executionError.error = "order is required and must be specified" + executionError.error = "order is required and must be specified" return localVarReturnValue, nil, executionError } @@ -505,21 +505,21 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localVarPostBody = r.order req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index 6597a0e65a33..e1cdc94c9a3e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -11,7 +11,7 @@ package petstore import ( - "bytes" + "bytes" _context "context" _ioutil "io/ioutil" _nethttp "net/http" @@ -172,12 +172,12 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -187,7 +187,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -212,21 +212,21 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -278,12 +278,12 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -293,7 +293,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -318,21 +318,21 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -384,12 +384,12 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -399,7 +399,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -424,21 +424,21 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -489,12 +489,12 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -524,21 +524,21 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -589,13 +589,13 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -625,21 +625,21 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -706,13 +706,13 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError} } @@ -722,11 +722,11 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.username == nil { - executionError.error = "username is required and must be specified" + executionError.error = "username is required and must be specified" return localVarReturnValue, nil, executionError } if r.password == nil { - executionError.error = "password is required and must be specified" + executionError.error = "password is required and must be specified" return localVarReturnValue, nil, executionError } @@ -751,21 +751,21 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarReturnValue, localVarHTTPResponse, executionError } @@ -821,12 +821,12 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -855,21 +855,21 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } @@ -925,12 +925,12 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarFormFileName string localVarFileName string localVarFileBytes []byte - executionError GenericOpenAPIError + executionError GenericOpenAPIError ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError} } @@ -941,7 +941,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.user == nil { - executionError.error = "user is required and must be specified" + executionError.error = "user is required and must be specified" return nil, executionError } @@ -966,21 +966,21 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return nil, executionError } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - executionError.error = err.Error() + executionError.error = err.Error() return localVarHTTPResponse, executionError } From b82207b484ce0e5e88c7b8c45569745a7c4b236f Mon Sep 17 00:00:00 2001 From: Aanisha Mishra Date: Wed, 9 Dec 2020 22:41:37 +0530 Subject: [PATCH 06/11] remove extra brackets --- modules/openapi-generator/src/main/resources/go/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index f168daeaadea..92c612347127 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -102,7 +102,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") if err != nil { executionError.error = err.Error() - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError} + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, executionError } localVarPath := localBasePath + "{{{path}}}"{{#pathParams}} From 0176e83be612279329ae13496ee687de0ca4cdc6 Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Thu, 10 Dec 2020 11:09:13 +0530 Subject: [PATCH 07/11] update sample generation --- .../go/go-petstore/api_another_fake.go | 2 +- .../petstore/go/go-petstore/api_fake.go | 28 +++++++++---------- .../go-petstore/api_fake_classname_tags123.go | 2 +- .../client/petstore/go/go-petstore/api_pet.go | 18 ++++++------ .../petstore/go/go-petstore/api_store.go | 8 +++--- .../petstore/go/go-petstore/api_user.go | 16 +++++------ .../go-experimental/api_usage.go | 8 +++--- .../go/go-petstore/api_another_fake.go | 2 +- .../petstore/go/go-petstore/api_default.go | 2 +- .../petstore/go/go-petstore/api_fake.go | 28 +++++++++---------- .../go-petstore/api_fake_classname_tags123.go | 2 +- .../client/petstore/go/go-petstore/api_pet.go | 18 ++++++------ .../petstore/go/go-petstore/api_store.go | 8 +++--- .../petstore/go/go-petstore/api_user.go | 16 +++++------ 14 files changed, 79 insertions(+), 79 deletions(-) diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index 954850f10ff9..01ed9905da7a 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -89,7 +89,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/another-fake/dummy" diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index c2a68fa8db34..f6d890ebda39 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -263,7 +263,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/create_xml_item" @@ -372,7 +372,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/outer/boolean" @@ -486,7 +486,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/outer/composite" @@ -600,7 +600,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/outer/number" @@ -714,7 +714,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/outer/string" @@ -826,7 +826,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/body-with-file-schema" @@ -937,7 +937,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/body-with-query-params" @@ -1051,7 +1051,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake" @@ -1235,7 +1235,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake" @@ -1445,7 +1445,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake" @@ -1595,7 +1595,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake" @@ -1719,7 +1719,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/inline-additionalProperties" @@ -1830,7 +1830,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/jsonFormData" @@ -1961,7 +1961,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/test-query-paramters" diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 79a80c29e4ea..a935409c5578 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -89,7 +89,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake_classname_test" diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index 0e6c2be7f388..48f83426726e 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -195,7 +195,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/pet" @@ -304,7 +304,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/pet/{petId}" @@ -411,7 +411,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/pet/findByStatus" @@ -528,7 +528,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/pet/findByTags" @@ -643,7 +643,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/pet/{petId}" @@ -767,7 +767,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/pet" @@ -881,7 +881,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/pet/{petId}" @@ -998,7 +998,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/pet/{petId}/uploadImage" @@ -1132,7 +1132,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 5984dc91d771..14554938b47b 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -128,7 +128,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/store/order/{order_id}" @@ -227,7 +227,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/store/inventory" @@ -351,7 +351,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/store/order/{order_id}" @@ -471,7 +471,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/store/order" diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 7ad49e656099..e4c0eaeef16c 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -178,7 +178,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user" @@ -284,7 +284,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/createWithArray" @@ -390,7 +390,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/createWithList" @@ -495,7 +495,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/{username}" @@ -596,7 +596,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/user/{username}" @@ -713,7 +713,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/user/login" @@ -827,7 +827,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/logout" @@ -931,7 +931,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/{username}" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index b1b56d212a04..c65c0c3ecbce 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -67,7 +67,7 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.AnyKey") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/any" @@ -202,7 +202,7 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.BothKeys") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/both" @@ -337,7 +337,7 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInHeader") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/header" @@ -458,7 +458,7 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInQuery") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/query" diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index fa8a8d65e410..cd176050f102 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -89,7 +89,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/another-fake/dummy" diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index bf23e98a3b2e..39cc4811b231 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -82,7 +82,7 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/foo" diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 65b72570e278..4efcec605884 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -260,7 +260,7 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeHealthGet") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/health" @@ -372,7 +372,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/outer/boolean" @@ -486,7 +486,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/outer/composite" @@ -600,7 +600,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/outer/number" @@ -714,7 +714,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/outer/string" @@ -826,7 +826,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/body-with-file-schema" @@ -937,7 +937,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/body-with-query-params" @@ -1051,7 +1051,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake" @@ -1236,7 +1236,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake" @@ -1446,7 +1446,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake" @@ -1604,7 +1604,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake" @@ -1728,7 +1728,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/inline-additionalProperties" @@ -1839,7 +1839,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/jsonFormData" @@ -1970,7 +1970,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/fake/test-query-paramters" diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 82fd15f5405b..74fc36e91d7d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -89,7 +89,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake_classname_test" diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index 195195c48e77..b0fc33bfdde1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -195,7 +195,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, G localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/pet" @@ -304,7 +304,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/pet/{petId}" @@ -411,7 +411,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/pet/findByStatus" @@ -528,7 +528,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/pet/findByTags" @@ -643,7 +643,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/pet/{petId}" @@ -767,7 +767,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/pet" @@ -881,7 +881,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/pet/{petId}" @@ -998,7 +998,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/pet/{petId}/uploadImage" @@ -1132,7 +1132,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index 36b9e2590452..1a6be58b7238 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -128,7 +128,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/store/order/{order_id}" @@ -227,7 +227,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/store/inventory" @@ -351,7 +351,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/store/order/{order_id}" @@ -471,7 +471,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/store/order" diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index e1cdc94c9a3e..9abef9ffe6e3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -178,7 +178,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user" @@ -284,7 +284,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/createWithArray" @@ -390,7 +390,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/createWithList" @@ -495,7 +495,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/{username}" @@ -596,7 +596,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/user/{username}" @@ -713,7 +713,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { executionError.error = err.Error() - return localVarReturnValue, nil, executionError} + return localVarReturnValue, nil, executionError } localVarPath := localBasePath + "/user/login" @@ -827,7 +827,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/logout" @@ -931,7 +931,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { executionError.error = err.Error() - return nil, executionError} + return nil, executionError } localVarPath := localBasePath + "/user/{username}" From 578c51435e04de044bcfca337b4654d6af2ece7b Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Mon, 14 Dec 2020 08:32:36 +0530 Subject: [PATCH 08/11] update go test cases --- samples/client/petstore/go/auth_test.go | 32 ++++++++--------- samples/client/petstore/go/fake_api_test.go | 2 +- .../client/petstore/go/mock/mock_api_pet.go | 36 +++++++++---------- samples/client/petstore/go/pet_api_test.go | 25 +++++++------ samples/client/petstore/go/store_api_test.go | 2 +- samples/client/petstore/go/user_api_test.go | 12 +++---- 6 files changed, 54 insertions(+), 55 deletions(-) diff --git a/samples/client/petstore/go/auth_test.go b/samples/client/petstore/go/auth_test.go index 0e532aeff3ac..8991f02a9b6f 100644 --- a/samples/client/petstore/go/auth_test.go +++ b/samples/client/petstore/go/auth_test.go @@ -43,7 +43,7 @@ func TestOAuth2(t *testing.T) { r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -52,7 +52,7 @@ func TestOAuth2(t *testing.T) { r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -78,7 +78,7 @@ func TestBasicAuth(t *testing.T) { r, err := client.PetApi.AddPet(auth).Body(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -87,7 +87,7 @@ func TestBasicAuth(t *testing.T) { r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -108,7 +108,7 @@ func TestAccessToken(t *testing.T) { r, err := client.PetApi.AddPet(nil).Body(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -117,7 +117,7 @@ func TestAccessToken(t *testing.T) { r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -138,7 +138,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -146,7 +146,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { } _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -156,7 +156,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { } r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -173,7 +173,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { r, err := client.PetApi.AddPet(nil).Body(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -181,7 +181,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { } _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -191,7 +191,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { } r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -206,7 +206,7 @@ func TestDefaultHeader(t *testing.T) { r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -215,7 +215,7 @@ func TestDefaultHeader(t *testing.T) { r, err = client.PetApi.DeletePet(context.Background(), 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -230,7 +230,7 @@ func TestDefaultHeader(t *testing.T) { func TestHostOverride(t *testing.T) { _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while finding pets by status: %v", err) } @@ -242,7 +242,7 @@ func TestHostOverride(t *testing.T) { func TestSchemeOverride(t *testing.T) { _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while finding pets by status: %v", err) } diff --git a/samples/client/petstore/go/fake_api_test.go b/samples/client/petstore/go/fake_api_test.go index d27137eeacfa..2de0ef77b2f9 100644 --- a/samples/client/petstore/go/fake_api_test.go +++ b/samples/client/petstore/go/fake_api_test.go @@ -19,7 +19,7 @@ func TestPutBodyWithFileSchema(t *testing.T) { r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).Body(schema).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { diff --git a/samples/client/petstore/go/mock/mock_api_pet.go b/samples/client/petstore/go/mock/mock_api_pet.go index 84686bb5f2e5..3828c3bb7722 100644 --- a/samples/client/petstore/go/mock/mock_api_pet.go +++ b/samples/client/petstore/go/mock/mock_api_pet.go @@ -20,70 +20,70 @@ func (m *MockPetApi) AddPet(ctx context.Context) sw.ApiAddPetRequest { return sw.ApiAddPetRequest{ApiService: m} } -func (m *MockPetApi) AddPetExecute(r sw.ApiAddPetRequest) (*http.Response, error) { - return &http.Response{StatusCode:200}, nil +func (m *MockPetApi) AddPetExecute(r sw.ApiAddPetRequest) (*http.Response, sw.GenericOpenAPIError) { + return &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } func (m *MockPetApi) DeletePet(ctx context.Context, petId int64) sw.ApiDeletePetRequest { return sw.ApiDeletePetRequest{ApiService: m} } -func (m *MockPetApi) DeletePetExecute(r sw.ApiDeletePetRequest) (*http.Response, error) { - return &http.Response{StatusCode:200}, nil +func (m *MockPetApi) DeletePetExecute(r sw.ApiDeletePetRequest) (*http.Response, sw.GenericOpenAPIError) { + return &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } func (m *MockPetApi) FindPetsByStatus(ctx context.Context) sw.ApiFindPetsByStatusRequest { return sw.ApiFindPetsByStatusRequest{ApiService: m} } -func (m *MockPetApi) FindPetsByStatusExecute(r sw.ApiFindPetsByStatusRequest) ([]sw.Pet, *http.Response, error) { - return []sw.Pet{}, &http.Response{StatusCode:200}, nil +func (m *MockPetApi) FindPetsByStatusExecute(r sw.ApiFindPetsByStatusRequest) ([]sw.Pet, *http.Response, sw.GenericOpenAPIError) { + return []sw.Pet{}, &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } func (m *MockPetApi) FindPetsByTags(ctx context.Context) sw.ApiFindPetsByTagsRequest { return sw.ApiFindPetsByTagsRequest{ApiService: m} } -func (m *MockPetApi) FindPetsByTagsExecute(r sw.ApiFindPetsByTagsRequest) ([]sw.Pet, *http.Response, error) { - return []sw.Pet{}, &http.Response{StatusCode:200}, nil +func (m *MockPetApi) FindPetsByTagsExecute(r sw.ApiFindPetsByTagsRequest) ([]sw.Pet, *http.Response, sw.GenericOpenAPIError) { + return []sw.Pet{}, &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } func (m *MockPetApi) GetPetById(ctx context.Context, petId int64) sw.ApiGetPetByIdRequest { return sw.ApiGetPetByIdRequest{ApiService: m} } -func (m *MockPetApi) GetPetByIdExecute(r sw.ApiGetPetByIdRequest) (sw.Pet, *http.Response, error) { - return sw.Pet{}, &http.Response{StatusCode:200}, nil +func (m *MockPetApi) GetPetByIdExecute(r sw.ApiGetPetByIdRequest) (sw.Pet, *http.Response, sw.GenericOpenAPIError) { + return sw.Pet{}, &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } func (m *MockPetApi) UpdatePet(ctx context.Context) sw.ApiUpdatePetRequest { return sw.ApiUpdatePetRequest{ApiService: m} } -func (m *MockPetApi) UpdatePetExecute(r sw.ApiUpdatePetRequest) (*http.Response, error) { - return &http.Response{StatusCode:200}, nil +func (m *MockPetApi) UpdatePetExecute(r sw.ApiUpdatePetRequest) (*http.Response, sw.GenericOpenAPIError) { + return &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } func (m *MockPetApi) UpdatePetWithForm(ctx context.Context, petId int64) sw.ApiUpdatePetWithFormRequest { return sw.ApiUpdatePetWithFormRequest{ApiService: m} } -func (m *MockPetApi) UpdatePetWithFormExecute(r sw.ApiUpdatePetWithFormRequest) (*http.Response, error) { - return &http.Response{StatusCode:200}, nil +func (m *MockPetApi) UpdatePetWithFormExecute(r sw.ApiUpdatePetWithFormRequest) (*http.Response, sw.GenericOpenAPIError) { + return &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } func (m *MockPetApi) UploadFile(ctx context.Context, petId int64) sw.ApiUploadFileRequest { return sw.ApiUploadFileRequest{ApiService: m} } -func (m *MockPetApi) UploadFileExecute(r sw.ApiUploadFileRequest) (sw.ApiResponse, *http.Response, error) { - return sw.ApiResponse{}, &http.Response{StatusCode:200}, nil +func (m *MockPetApi) UploadFileExecute(r sw.ApiUploadFileRequest) (sw.ApiResponse, *http.Response, sw.GenericOpenAPIError) { + return sw.ApiResponse{}, &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } func (m *MockPetApi) UploadFileWithRequiredFile(ctx context.Context, petId int64) sw.ApiUploadFileWithRequiredFileRequest { return sw.ApiUploadFileWithRequiredFileRequest{ApiService: m} } -func (m *MockPetApi) UploadFileWithRequiredFileExecute(r sw.ApiUploadFileWithRequiredFileRequest) (sw.ApiResponse, *http.Response, error) { - return sw.ApiResponse{}, &http.Response{StatusCode:200}, nil +func (m *MockPetApi) UploadFileWithRequiredFileExecute(r sw.ApiUploadFileWithRequiredFileRequest) (sw.ApiResponse, *http.Response, sw.GenericOpenAPIError) { + return sw.ApiResponse{}, &http.Response{StatusCode:200}, sw.GenericOpenAPIError{} } diff --git a/samples/client/petstore/go/pet_api_test.go b/samples/client/petstore/go/pet_api_test.go index 0868c4b96ccb..f241e8a90196 100644 --- a/samples/client/petstore/go/pet_api_test.go +++ b/samples/client/petstore/go/pet_api_test.go @@ -34,7 +34,7 @@ func TestAddPet(t *testing.T) { r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -54,7 +54,7 @@ func TestAddPetMock(t *testing.T) { func TestFindPetsByStatusWithMissingParam(t *testing.T) { _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) } if r.StatusCode != 200 { @@ -69,13 +69,12 @@ func TestGetPetById(t *testing.T) { func TestGetPetByIdWithInvalidID(t *testing.T) { resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() if r != nil && r.StatusCode == 404 { - assertedError, ok := err.(sw.GenericOpenAPIError) + assertedError := err a := assert.New(t) - a.True(ok) a.Contains(string(assertedError.Body()), "type") a.Contains(assertedError.Error(), "Not Found") - } else if err != nil { + } else if err.Error() != "" { t.Fatalf("Error while getting pet by invalid id: %v", err) t.Log(r) } else { @@ -85,7 +84,7 @@ func TestGetPetByIdWithInvalidID(t *testing.T) { func TestUpdatePetWithForm(t *testing.T) { r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830).Name("golang").Status("available").Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while updating pet by id: %v", err) t.Log(r) } @@ -100,7 +99,7 @@ func TestUpdatePetWithForm(t *testing.T) { func TestFindPetsByTag(t *testing.T) { var found = false resp, r, err := client.PetApi.FindPetsByTags(context.Background()).Tags([]string{"tag2"}).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting pet by tag: %v", err) t.Log(r) } else { @@ -129,7 +128,7 @@ func TestFindPetsByTag(t *testing.T) { func TestFindPetsByStatus(t *testing.T) { resp, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status([]string{"available"}).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting pet by id: %v", err) t.Log(r) } else { @@ -156,7 +155,7 @@ func TestUploadFile(t *testing.T) { _, r, err := client.PetApi.UploadFile(context.Background(), 12830).AdditionalMetadata("golang").File(file).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while uploading file: %v", err) } @@ -174,7 +173,7 @@ func TestUploadFileRequired(t *testing.T) { _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830).RequiredFile(file).AdditionalMetadata("golang").Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while uploading file: %v", err) } @@ -186,7 +185,7 @@ func TestUploadFileRequired(t *testing.T) { func TestDeletePet(t *testing.T) { r, err := client.PetApi.DeletePet(context.Background(), 12830).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -276,7 +275,7 @@ func waitOnFunctions(t *testing.T, errc chan error, n int) { func deletePet(t *testing.T, id int64) { r, err := client.PetApi.DeletePet(context.Background(), id).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -287,7 +286,7 @@ func deletePet(t *testing.T, id int64) { func isPetCorrect(t *testing.T, id int64, name string, status string) { assert := assert.New(t) resp, r, err := client.PetApi.GetPetById(context.Background(), id).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting pet by id: %v", err) } else { assert.Equal(*resp.Id, int64(id), "Pet id should be equal") diff --git a/samples/client/petstore/go/store_api_test.go b/samples/client/petstore/go/store_api_test.go index f9f55273eb92..ea97848fe1db 100644 --- a/samples/client/petstore/go/store_api_test.go +++ b/samples/client/petstore/go/store_api_test.go @@ -20,7 +20,7 @@ func TestPlaceOrder(t *testing.T) { _, r, err := client.StoreApi.PlaceOrder(context.Background()).Body(newOrder).Execute() - if err != nil { + if err.Error() != "" { // Skip parsing time error due to error in Petstore Test Server // https://github.com/OpenAPITools/openapi-generator/issues/1292 if regexp. diff --git a/samples/client/petstore/go/user_api_test.go b/samples/client/petstore/go/user_api_test.go index 361e77ac9aa7..d7329bed49ec 100644 --- a/samples/client/petstore/go/user_api_test.go +++ b/samples/client/petstore/go/user_api_test.go @@ -22,7 +22,7 @@ func TestCreateUser(t *testing.T) { apiResponse, err := client.UserApi.CreateUser(context.Background()).Body(newUser).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding user: %v", err) } if apiResponse.StatusCode != 200 { @@ -56,7 +56,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { } apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background()).Body(newUsers).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding users: %v", err) } if apiResponse.StatusCode != 200 { @@ -82,7 +82,7 @@ func TestGetUserByName(t *testing.T) { assert := assert.New(t) resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting user by id: %v", err) } else { assert.Equal(*resp.Id, int64(1000), "User id should be equal") @@ -99,7 +99,7 @@ func TestGetUserByNameWithInvalidID(t *testing.T) { resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999").Execute() if apiResponse != nil && apiResponse.StatusCode == 404 { return // This is a pass condition. API will return with a 404 error. - } else if err != nil { + } else if err.Error() != "" { t.Fatalf("Error while getting user by invalid id: %v", err) t.Log(apiResponse) } else { @@ -124,7 +124,7 @@ func TestUpdateUser(t *testing.T) { UserStatus: sw.PtrInt32(1)} apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher").Body(newUser).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting user by id: %v", err) } if apiResponse.StatusCode != 200 { @@ -133,7 +133,7 @@ func TestUpdateUser(t *testing.T) { //verify changings are correct resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting user by id: %v", err) } else { assert.Equal(*resp.Id, int64(1000), "User id should be equal") From 88fb2eb509afd1c2c7e7149c3d0bb1eb97e40978 Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Mon, 14 Dec 2020 09:11:09 +0530 Subject: [PATCH 09/11] update openapi3 go tests --- .../openapi3/client/petstore/go/auth_test.go | 32 +++++++++---------- .../client/petstore/go/fake_api_test.go | 2 +- .../client/petstore/go/http_signature_test.go | 6 ++-- .../client/petstore/go/pet_api_test.go | 25 +++++++-------- .../client/petstore/go/store_api_test.go | 2 +- .../client/petstore/go/user_api_test.go | 12 +++---- 6 files changed, 39 insertions(+), 40 deletions(-) diff --git a/samples/openapi3/client/petstore/go/auth_test.go b/samples/openapi3/client/petstore/go/auth_test.go index aec544c2f26f..0da295cc4812 100644 --- a/samples/openapi3/client/petstore/go/auth_test.go +++ b/samples/openapi3/client/petstore/go/auth_test.go @@ -43,7 +43,7 @@ func TestOAuth2(t *testing.T) { r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -52,7 +52,7 @@ func TestOAuth2(t *testing.T) { r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -78,7 +78,7 @@ func TestBasicAuth(t *testing.T) { r, err := client.PetApi.AddPet(auth).Pet(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -87,7 +87,7 @@ func TestBasicAuth(t *testing.T) { r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -108,7 +108,7 @@ func TestAccessToken(t *testing.T) { r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -117,7 +117,7 @@ func TestAccessToken(t *testing.T) { r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -138,7 +138,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -146,7 +146,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { } _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -156,7 +156,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { } r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -173,7 +173,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -181,7 +181,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { } _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -191,7 +191,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { } r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -206,7 +206,7 @@ func TestDefaultHeader(t *testing.T) { r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -215,7 +215,7 @@ func TestDefaultHeader(t *testing.T) { r, err = client.PetApi.DeletePet(context.Background(), 12992).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -230,7 +230,7 @@ func TestDefaultHeader(t *testing.T) { func TestHostOverride(t *testing.T) { _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while finding pets by status: %v", err) } @@ -242,7 +242,7 @@ func TestHostOverride(t *testing.T) { func TestSchemeOverride(t *testing.T) { _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while finding pets by status: %v", err) } diff --git a/samples/openapi3/client/petstore/go/fake_api_test.go b/samples/openapi3/client/petstore/go/fake_api_test.go index 97910bf3cf7b..d93c11f85394 100644 --- a/samples/openapi3/client/petstore/go/fake_api_test.go +++ b/samples/openapi3/client/petstore/go/fake_api_test.go @@ -19,7 +19,7 @@ func TestPutBodyWithFileSchema(t *testing.T) { r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(schema).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { diff --git a/samples/openapi3/client/petstore/go/http_signature_test.go b/samples/openapi3/client/petstore/go/http_signature_test.go index 6348599111a6..26d0e551e1c6 100644 --- a/samples/openapi3/client/petstore/go/http_signature_test.go +++ b/samples/openapi3/client/petstore/go/http_signature_test.go @@ -282,11 +282,11 @@ func executeHttpSignatureAuth(t *testing.T, authConfig *sw.HttpSignatureAuth, ex authConfig.SigningScheme, authConfig.SigningAlgorithm, authConfig.SignatureMaxValidity, authConfig.SignedHeaders) r, err2 := apiClient.PetApi.AddPet(authCtx).Pet(newPet).Execute() - if expectSuccess && err2 != nil { + if expectSuccess && err2.Error() != "" { t.Fatalf("Error while adding pet: %v", err2) } if !expectSuccess { - if err2 == nil { + if err2.Error() != "" { t.Fatalf("Error was expected, but no error was generated") } else { // Do not continue. Error is expected. @@ -298,7 +298,7 @@ func executeHttpSignatureAuth(t *testing.T, authConfig *sw.HttpSignatureAuth, ex } _, r, err = apiClient.PetApi.GetPetById(authCtx, 12992).Execute() - if expectSuccess && err != nil { + if expectSuccess && err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } diff --git a/samples/openapi3/client/petstore/go/pet_api_test.go b/samples/openapi3/client/petstore/go/pet_api_test.go index 9f0a154f96a0..999d06fa9b9f 100644 --- a/samples/openapi3/client/petstore/go/pet_api_test.go +++ b/samples/openapi3/client/petstore/go/pet_api_test.go @@ -33,7 +33,7 @@ func TestAddPet(t *testing.T) { r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding pet: %v", err) } if r.StatusCode != 200 { @@ -44,7 +44,7 @@ func TestAddPet(t *testing.T) { func TestFindPetsByStatusWithMissingParam(t *testing.T) { _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) } if r.StatusCode != 200 { @@ -59,13 +59,12 @@ func TestGetPetById(t *testing.T) { func TestGetPetByIdWithInvalidID(t *testing.T) { resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() if r != nil && r.StatusCode == 404 { - assertedError, ok := err.(sw.GenericOpenAPIError) + assertedError:= err a := assert.New(t) - a.True(ok) a.Contains(string(assertedError.Body()), "type") a.Contains(assertedError.Error(), "Not Found") - } else if err != nil { + } else if err.Error() != "" { t.Fatalf("Error while getting pet by invalid id: %v", err) t.Log(r) } else { @@ -75,7 +74,7 @@ func TestGetPetByIdWithInvalidID(t *testing.T) { func TestUpdatePetWithForm(t *testing.T) { r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830).Name("golang").Status("available").Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while updating pet by id: %v", err) t.Log(r) } @@ -90,7 +89,7 @@ func TestUpdatePetWithForm(t *testing.T) { func TestFindPetsByTag(t *testing.T) { var found = false resp, r, err := client.PetApi.FindPetsByTags(context.Background()).Tags([]string{"tag2"}).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting pet by tag: %v", err) t.Log(r) } else { @@ -119,7 +118,7 @@ func TestFindPetsByTag(t *testing.T) { func TestFindPetsByStatus(t *testing.T) { resp, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status([]string{"available"}).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting pet by id: %v", err) t.Log(r) } else { @@ -146,7 +145,7 @@ func TestUploadFile(t *testing.T) { _, r, err := client.PetApi.UploadFile(context.Background(), 12830).AdditionalMetadata("golang").File(file).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while uploading file: %v", err) } @@ -164,7 +163,7 @@ func TestUploadFileRequired(t *testing.T) { _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830).RequiredFile(file).AdditionalMetadata("golang").Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while uploading file: %v", err) } @@ -176,7 +175,7 @@ func TestUploadFileRequired(t *testing.T) { func TestDeletePet(t *testing.T) { r, err := client.PetApi.DeletePet(context.Background(), 12830).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -266,7 +265,7 @@ func waitOnFunctions(t *testing.T, errc chan error, n int) { func deletePet(t *testing.T, id int64) { r, err := client.PetApi.DeletePet(context.Background(), id).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting pet by id: %v", err) } if r.StatusCode != 200 { @@ -277,7 +276,7 @@ func deletePet(t *testing.T, id int64) { func isPetCorrect(t *testing.T, id int64, name string, status string) { assert := assert.New(t) resp, r, err := client.PetApi.GetPetById(context.Background(), id).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting pet by id: %v", err) } else { assert.Equal(*resp.Id, int64(id), "Pet id should be equal") diff --git a/samples/openapi3/client/petstore/go/store_api_test.go b/samples/openapi3/client/petstore/go/store_api_test.go index fc0cdec9699a..0fb6cdaa0a69 100644 --- a/samples/openapi3/client/petstore/go/store_api_test.go +++ b/samples/openapi3/client/petstore/go/store_api_test.go @@ -20,7 +20,7 @@ func TestPlaceOrder(t *testing.T) { _, r, err := client.StoreApi.PlaceOrder(context.Background()).Order(newOrder).Execute() - if err != nil { + if err.Error() != "" { // Skip parsing time error due to error in Petstore Test Server // https://github.com/OpenAPITools/openapi-generator/issues/1292 if regexp. diff --git a/samples/openapi3/client/petstore/go/user_api_test.go b/samples/openapi3/client/petstore/go/user_api_test.go index ef66e2410c06..918221e1c857 100644 --- a/samples/openapi3/client/petstore/go/user_api_test.go +++ b/samples/openapi3/client/petstore/go/user_api_test.go @@ -22,7 +22,7 @@ func TestCreateUser(t *testing.T) { apiResponse, err := client.UserApi.CreateUser(context.Background()).User(newUser).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding user: %v", err) } if apiResponse.StatusCode != 200 { @@ -56,7 +56,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { } apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background()).User(newUsers).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while adding users: %v", err) } if apiResponse.StatusCode != 200 { @@ -83,7 +83,7 @@ func TestGetUserByName(t *testing.T) { assert := assert.New(t) resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting user by id: %v", err) } else { assert.Equal(*resp.Id, int64(1000), "User id should be equal") @@ -100,7 +100,7 @@ func TestGetUserByNameWithInvalidID(t *testing.T) { resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999").Execute() if apiResponse != nil && apiResponse.StatusCode == 404 { return // This is a pass condition. API will return with a 404 error. - } else if err != nil { + } else if err.Error() != "" { t.Fatalf("Error while getting user by invalid id: %v", err) t.Log(apiResponse) } else { @@ -125,7 +125,7 @@ func TestUpdateUser(t *testing.T) { UserStatus: sw.PtrInt32(1)} apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher").User(newUser).Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while deleting user by id: %v", err) } if apiResponse.StatusCode != 200 { @@ -134,7 +134,7 @@ func TestUpdateUser(t *testing.T) { //verify changings are correct resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() - if err != nil { + if err.Error() != "" { t.Fatalf("Error while getting user by id: %v", err) } else { assert.Equal(*resp.Id, int64(1000), "User id should be equal") From fd7a8a1e9ec3997dae5518c9ac3e20ef527c610f Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Mon, 14 Dec 2020 10:20:11 +0530 Subject: [PATCH 10/11] edit test samples --- samples/openapi3/client/petstore/go/http_signature_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/openapi3/client/petstore/go/http_signature_test.go b/samples/openapi3/client/petstore/go/http_signature_test.go index 26d0e551e1c6..1561c6d8ddf9 100644 --- a/samples/openapi3/client/petstore/go/http_signature_test.go +++ b/samples/openapi3/client/petstore/go/http_signature_test.go @@ -286,7 +286,7 @@ func executeHttpSignatureAuth(t *testing.T, authConfig *sw.HttpSignatureAuth, ex t.Fatalf("Error while adding pet: %v", err2) } if !expectSuccess { - if err2.Error() != "" { + if err2.Error() == "" { t.Fatalf("Error was expected, but no error was generated") } else { // Do not continue. Error is expected. From 180e4a3971e92b66a2a1d16c66e8d0f05a9e9592 Mon Sep 17 00:00:00 2001 From: code-lucidal58 Date: Mon, 14 Dec 2020 22:02:51 +0530 Subject: [PATCH 11/11] update documentation --- .../src/main/resources/go/api_doc.mustache | 2 +- .../go/go-petstore/docs/AnotherFakeApi.md | 2 +- .../petstore/go/go-petstore/docs/FakeApi.md | 28 +++++++++---------- .../docs/FakeClassnameTags123Api.md | 2 +- .../petstore/go/go-petstore/docs/PetApi.md | 18 ++++++------ .../petstore/go/go-petstore/docs/StoreApi.md | 8 +++--- .../petstore/go/go-petstore/docs/UserApi.md | 16 +++++------ .../go-experimental/docs/UsageApi.md | 8 +++--- .../go/go-petstore/docs/AnotherFakeApi.md | 2 +- .../go/go-petstore/docs/DefaultApi.md | 2 +- .../petstore/go/go-petstore/docs/FakeApi.md | 28 +++++++++---------- .../docs/FakeClassnameTags123Api.md | 2 +- .../petstore/go/go-petstore/docs/PetApi.md | 18 ++++++------ .../petstore/go/go-petstore/docs/StoreApi.md | 8 +++--- .../petstore/go/go-petstore/docs/UserApi.md | 16 +++++------ 15 files changed, 80 insertions(+), 80 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/api_doc.mustache b/modules/openapi-generator/src/main/resources/go/api_doc.mustache index 458465f89476..1c7d3865ca19 100644 --- a/modules/openapi-generator/src/main/resources/go/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go/api_doc.mustache @@ -43,7 +43,7 @@ func main() { configuration := {{goImportAlias}}.NewConfiguration() api_client := {{goImportAlias}}.NewAPIClient(configuration) resp, r, err := api_client.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md index 6243abe3c4d7..5a40763d89a1 100644 --- a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md @@ -34,7 +34,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.AnotherFakeApi.Call123TestSpecialTags(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeApi.Call123TestSpecialTags``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/client/petstore/go/go-petstore/docs/FakeApi.md index 382058dc4db3..b64acb3da74c 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeApi.md @@ -47,7 +47,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.CreateXmlItem(context.Background()).XmlItem(xmlItem).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.CreateXmlItem``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -111,7 +111,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterBooleanSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -177,7 +177,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeOuterCompositeSerialize(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterCompositeSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -243,7 +243,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterNumberSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -309,7 +309,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeOuterStringSerialize(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterStringSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -375,7 +375,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestBodyWithFileSchema(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithFileSchema``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -438,7 +438,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestBodyWithQueryParams(context.Background()).Query(query).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithQueryParams``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -503,7 +503,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestClientModel(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestClientModel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -583,7 +583,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEndpointParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -667,7 +667,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEnumParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -743,7 +743,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestGroupParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -810,7 +810,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestInlineAdditionalProperties(context.Background()).Param(param).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestInlineAdditionalProperties``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -873,7 +873,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestJsonFormData``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -942,7 +942,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryParameterCollectionFormat``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md index b206d05d09c7..ac3040d4b469 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md @@ -34,7 +34,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeClassnameTags123Api.TestClassname(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123Api.TestClassname``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/client/petstore/go/go-petstore/docs/PetApi.md b/samples/client/petstore/go/go-petstore/docs/PetApi.md index d93265c16ed7..7ded65ebcaec 100644 --- a/samples/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore/docs/PetApi.md @@ -40,7 +40,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.AddPet(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.AddPet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -103,7 +103,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.DeletePet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -172,7 +172,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.FindPetsByStatus(context.Background()).Status(status).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByStatus``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -238,7 +238,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.FindPetsByTags(context.Background()).Tags(tags).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByTags``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -304,7 +304,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.GetPetById(context.Background(), petId).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.GetPetById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -372,7 +372,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.UpdatePet(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -436,7 +436,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePetWithForm``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -506,7 +506,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -578,7 +578,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFileWithRequiredFile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/client/petstore/go/go-petstore/docs/StoreApi.md index 1e5c0ae5ba82..c97d2ab643c8 100644 --- a/samples/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/client/petstore/go/go-petstore/docs/StoreApi.md @@ -37,7 +37,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.StoreApi.DeleteOrder(context.Background(), orderId).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.DeleteOrder``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -104,7 +104,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.StoreApi.GetInventory(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetInventory``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -166,7 +166,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.StoreApi.GetOrderById(context.Background(), orderId).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetOrderById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -234,7 +234,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.StoreApi.PlaceOrder(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.PlaceOrder``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/client/petstore/go/go-petstore/docs/UserApi.md b/samples/client/petstore/go/go-petstore/docs/UserApi.md index e1623fabec46..712e0de87dee 100644 --- a/samples/client/petstore/go/go-petstore/docs/UserApi.md +++ b/samples/client/petstore/go/go-petstore/docs/UserApi.md @@ -41,7 +41,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.CreateUser(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -103,7 +103,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.CreateUsersWithArrayInput(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithArrayInput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -165,7 +165,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.CreateUsersWithListInput(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithListInput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -229,7 +229,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -295,7 +295,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.GetUserByName(context.Background(), username).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserByName``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -364,7 +364,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.LoginUser(context.Background()).Username(username).Password(password).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LoginUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -428,7 +428,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.LogoutUser(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LogoutUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -489,7 +489,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.UpdateUser(context.Background(), username).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UpdateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageApi.md b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageApi.md index 6322c976a683..86886e788654 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageApi.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageApi.md @@ -36,7 +36,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UsageApi.AnyKey(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.AnyKey``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -97,7 +97,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UsageApi.BothKeys(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.BothKeys``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -158,7 +158,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UsageApi.KeyInHeader(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.KeyInHeader``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -219,7 +219,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UsageApi.KeyInQuery(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.KeyInQuery``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md index cd383de7c66c..61bca6d3f217 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md @@ -34,7 +34,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.AnotherFakeApi.Call123TestSpecialTags(context.Background()).Client(client).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeApi.Call123TestSpecialTags``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md index 9f60fbb4ec04..68ec4cee33b4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md @@ -31,7 +31,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.DefaultApi.FooGet(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FooGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md index 9021892276ca..83bb9c1dcb65 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md @@ -44,7 +44,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeHealthGet(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeHealthGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -106,7 +106,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterBooleanSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -172,7 +172,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeOuterCompositeSerialize(context.Background()).OuterComposite(outerComposite).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterCompositeSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -238,7 +238,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterNumberSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -304,7 +304,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.FakeOuterStringSerialize(context.Background()).Body(body).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterStringSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -370,7 +370,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(fileSchemaTestClass).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithFileSchema``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -433,7 +433,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestBodyWithQueryParams(context.Background()).Query(query).User(user).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithQueryParams``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -498,7 +498,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestClientModel(context.Background()).Client(client).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestClientModel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -578,7 +578,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEndpointParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -662,7 +662,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEnumParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -738,7 +738,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestGroupParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -805,7 +805,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestInlineAdditionalProperties(context.Background()).RequestBody(requestBody).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestInlineAdditionalProperties``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -868,7 +868,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestJsonFormData``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -937,7 +937,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeApi.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryParameterCollectionFormat``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md index 27a260ff8130..a4ae5edae874 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md @@ -34,7 +34,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FakeClassnameTags123Api.TestClassname(context.Background()).Client(client).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123Api.TestClassname``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md index c99794e706dc..1eed51f91aa5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md @@ -40,7 +40,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.AddPet(context.Background()).Pet(pet).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.AddPet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -103,7 +103,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.DeletePet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -172,7 +172,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.FindPetsByStatus(context.Background()).Status(status).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByStatus``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -238,7 +238,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.FindPetsByTags(context.Background()).Tags(tags).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByTags``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -304,7 +304,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.GetPetById(context.Background(), petId).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.GetPetById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -372,7 +372,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.UpdatePet(context.Background()).Pet(pet).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -436,7 +436,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePetWithForm``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -506,7 +506,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -578,7 +578,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.PetApi.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFileWithRequiredFile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md index 067ea3825762..a94618d626be 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md @@ -37,7 +37,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.StoreApi.DeleteOrder(context.Background(), orderId).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.DeleteOrder``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -104,7 +104,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.StoreApi.GetInventory(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetInventory``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -166,7 +166,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.StoreApi.GetOrderById(context.Background(), orderId).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetOrderById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -234,7 +234,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.StoreApi.PlaceOrder(context.Background()).Order(order).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.PlaceOrder``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md index dbbbe3fa792e..df784307bd0d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md @@ -41,7 +41,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.CreateUser(context.Background()).User(user).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -103,7 +103,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.CreateUsersWithArrayInput(context.Background()).User(user).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithArrayInput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -165,7 +165,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.CreateUsersWithListInput(context.Background()).User(user).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithListInput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -229,7 +229,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -295,7 +295,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.GetUserByName(context.Background(), username).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserByName``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -364,7 +364,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.LoginUser(context.Background()).Username(username).Password(password).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LoginUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -428,7 +428,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.LogoutUser(context.Background()).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LogoutUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } @@ -489,7 +489,7 @@ func main() { configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.UpdateUser(context.Background(), username).User(user).Execute() - if err != nil { + if err.Error() != "" { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UpdateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) }