From 19fd48e33b66c3d26b42bc4658c1f54ed413a232 Mon Sep 17 00:00:00 2001 From: John Wang Date: Thu, 12 Jul 2018 11:53:38 -0500 Subject: [PATCH] [Golang][client] fix `formData` `file` parameter name use (#506) * support form-data file MIME `name` parameter * update test spec and Go client for form-data file name * update samples for ensure-up-to-date * update mustache template * update samples for Go client * improve assignment location * update samples --- .../src/main/resources/go/api.mustache | 10 +- .../src/main/resources/go/client.mustache | 3 +- ...ith-fake-endpoints-models-for-testing.yaml | 4 +- ...ith-fake-endpoints-models-for-testing.yaml | 9 +- .../petstore/go/go-petstore/api/openapi.yaml | 5 +- .../go/go-petstore/api_another_fake.go | 9 +- .../petstore/go/go-petstore/api_fake.go | 100 ++++++++++-------- .../go-petstore/api_fake_classname_tags123.go | 9 +- .../client/petstore/go/go-petstore/api_pet.go | 89 +++++++++------- .../petstore/go/go-petstore/api_store.go | 36 ++++--- .../petstore/go/go-petstore/api_user.go | 72 +++++++------ .../client/petstore/go/go-petstore/client.go | 3 +- .../petstore/go/go-petstore/docs/PetApi.md | 4 +- .../petstore/go/go-petstore/model_file.go | 1 + .../org/openapitools/client/api/PetApi.java | 4 +- .../java/google-api-client/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 28 ++--- .../petstore/java/jersey1/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 14 +-- .../java/jersey2-java6/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 20 ++-- .../java/jersey2-java8/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 20 ++-- .../petstore/java/jersey2/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 20 ++-- .../docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 36 +++---- .../petstore/java/okhttp-gson/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 36 +++---- .../petstore/java/rest-assured/docs/PetApi.md | 6 +- .../org/openapitools/client/api/PetApi.java | 8 +- .../petstore/java/resteasy/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 14 +-- .../java/resttemplate-withXml/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 14 +-- .../petstore/java/resttemplate/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 14 +-- .../org/openapitools/client/api/PetApi.java | 8 +- .../java/retrofit2-play24/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 4 +- .../java/retrofit2-play25/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 4 +- .../petstore/java/retrofit2/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 4 +- .../petstore/java/retrofit2rx/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 4 +- .../petstore/java/retrofit2rx2/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 4 +- .../client/petstore/java/vertx/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 2 +- .../openapitools/client/api/PetApiImpl.java | 12 +-- .../client/api/rxjava/PetApi.java | 12 +-- .../petstore/java/webclient/docs/PetApi.md | 8 +- .../org/openapitools/client/api/PetApi.java | 14 +-- .../php/OpenAPIClient-php/docs/Api/PetApi.md | 8 +- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 38 +++---- .../php/OpenAPIClient-php/lib/Model/File.php | 1 + .../OpenAPIClient-php/test/Model/FileTest.php | 2 +- samples/client/petstore/ruby/docs/PetApi.md | 8 +- .../petstore/ruby/lib/petstore/api/pet_api.rb | 18 ++-- .../petstore/ruby/lib/petstore/models/file.rb | 1 + .../php/OpenAPIClient-php/docs/Api/PetApi.md | 8 +- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 38 +++---- .../gen/java/org/openapitools/api/PetApi.java | 2 +- .../api/impl/PetApiServiceImpl.java | 2 +- .../java/org/openapitools/api/PetApiTest.java | 4 +- .../java/org/openapitools/api/FakeApi.java | 6 +- .../org/openapitools/api/FakeApiService.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 4 +- .../src/main/openapi/openapi.yaml | 5 +- .../java/org/openapitools/api/FakeApi.java | 4 +- .../jaxrs-spec/src/main/openapi/openapi.yaml | 5 +- .../gen/java/org/openapitools/api/PetApi.java | 4 +- .../org/openapitools/api/PetApiService.java | 2 +- .../api/impl/PetApiServiceImpl.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 4 +- .../org/openapitools/api/FakeApiService.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 2 +- .../gen/java/org/openapitools/api/PetApi.java | 6 +- .../org/openapitools/api/PetApiService.java | 2 +- .../api/impl/PetApiServiceImpl.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 6 +- .../org/openapitools/api/FakeApiService.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/api/FakeApiController.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/api/FakeApiController.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 4 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/api/FakeApiController.java | 4 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../src/main/resources/openapi.yaml | 5 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- 101 files changed, 536 insertions(+), 489 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index f028d8d8b2..8b2943af55 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -67,9 +67,10 @@ type {{{nickname}}}Opts struct { func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("{{httpMethod}}") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte {{#returnType}} localVarReturnValue {{{returnType}}} {{/returnType}} @@ -177,6 +178,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{#hasFormParams}} {{#formParams}} {{#isFile}} + localVarFormFileName = "{{baseName}}" {{#required}} localVarFile := {{paramName}} {{/required}} @@ -254,7 +256,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{/isApiKey}} {{/authMethods}} - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err } diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index df1018defc..a6aec18485 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -167,6 +167,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, + formFileName string, fileName string, fileBytes []byte) (localVarRequest *http.Request, err error) { @@ -209,7 +210,7 @@ func (c *APIClient) prepareRequest( if len(fileBytes) > 0 && fileName != "" { w.Boundary() //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile("file", filepath.Base(fileName)) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) if err != nil { return nil, err } diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index f96e9750ab..7661071966 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -987,7 +987,7 @@ paths: description: Additional data to pass to server required: false type: string - - name: file + - name: requiredFile in: formData description: file to upload required: true @@ -1526,7 +1526,7 @@ definitions: $ref: "#/definitions/File" File: type: object - desription: 'Must be named `File` for test.' + description: 'Must be named `File` for test.' properties: sourceURI: description: 'Test capitalization' diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 1e690c16d6..bda4b8071d 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1,6 +1,4 @@ openapi: 3.0.0 -servers: - - url: 'http://petstore.swagger.io:80/v2' info: description: >- This spec is mainly for testing Petstore server and contains fake endpoints, @@ -573,7 +571,6 @@ paths: parameters: - name: enum_header_string_array in: header - explode: true description: Header parameter enum test (string array) schema: type: array @@ -964,12 +961,14 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload type: string format: binary required: - - file + - requiredFile +servers: + - url: 'http://petstore.swagger.io:80/v2' components: requestBodies: UserArray: diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index d8726d724f..1843427a4f 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1008,12 +1008,12 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload format: binary type: string required: - - file + - requiredFile required: true responses: 200: @@ -1507,6 +1507,7 @@ components: $ref: '#/components/schemas/Animal' type: array File: + description: Must be named `File` for test. example: sourceURI: sourceURI properties: 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 b9676e5e8b..7a8691ec37 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -34,9 +34,10 @@ To test special tags func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Client ) @@ -66,7 +67,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Clie } // body params localVarPostBody = &client - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 52536427da..237877e063 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -42,9 +42,10 @@ type FakeOuterBooleanSerializeOpts struct { func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue bool ) @@ -77,7 +78,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -138,9 +139,10 @@ type FakeOuterCompositeSerializeOpts struct { func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue OuterComposite ) @@ -177,7 +179,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPostBody = &localVarOptionalOuterComposite } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -238,9 +240,10 @@ type FakeOuterNumberSerializeOpts struct { func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue float32 ) @@ -273,7 +276,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -334,9 +337,10 @@ type FakeOuterStringSerializeOpts struct { func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue string ) @@ -369,7 +373,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -423,9 +427,10 @@ For this test, the body for this request much reference a schema named `Fil func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -454,7 +459,7 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaT } // body params localVarPostBody = &fileSchemaTestClass - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -490,9 +495,10 @@ FakeApiService func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, user User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -522,7 +528,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -559,9 +565,10 @@ To test \"client\" model func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Client ) @@ -591,7 +598,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl } // body params localVarPostBody = &client - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -673,9 +680,10 @@ type TestEndpointParametersOpts struct { func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -733,6 +741,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } localVarFormParams.Add("pattern_without_delimiter", parameterToString(patternWithoutDelimiter, "")) localVarFormParams.Add("byte", parameterToString(byte_, "")) + localVarFormFileName = "binary" var localVarFile *os.File if localVarOptionals != nil && localVarOptionals.Binary.IsSet() { localVarFileOk := false @@ -759,7 +768,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -815,9 +824,10 @@ type TestEnumParametersOpts struct { func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -868,7 +878,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -903,9 +913,10 @@ FakeApiService test inline additionalProperties func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody map[string]string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -934,7 +945,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, req } // body params localVarPostBody = &requestBody - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -970,9 +981,10 @@ FakeApiService test json serialization of form data func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -1001,7 +1013,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par } localVarFormParams.Add("param", parameterToString(param, "")) localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } 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 78a0effb2b..b194fc53f9 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 @@ -34,9 +34,10 @@ To test class name in snake case func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, client Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Client ) @@ -79,7 +80,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index 9c933feeb5..49f60d43de 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -35,9 +35,10 @@ PetApiService Add a new pet to the store func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -66,7 +67,7 @@ func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, er } // body params localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -108,9 +109,10 @@ type DeletePetOpts struct { func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -141,7 +143,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -178,9 +180,10 @@ Multiple status values can be provided with comma separated strings func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue []Pet ) @@ -209,7 +212,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -264,9 +267,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue []Pet ) @@ -295,7 +299,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -350,9 +354,10 @@ Returns a single pet func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Pet ) @@ -394,7 +399,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -447,9 +452,10 @@ PetApiService Update an existing pet func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -478,7 +484,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, } // body params localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -522,9 +528,10 @@ type UpdatePetWithFormOpts struct { func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -558,7 +565,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca if localVarOptionals != nil && localVarOptionals.Status.IsSet() { localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -603,9 +610,10 @@ type UploadFileOpts struct { func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue ApiResponse ) @@ -637,6 +645,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) } + localVarFormFileName = "file" var localVarFile *os.File if localVarOptionals != nil && localVarOptionals.File.IsSet() { localVarFileOk := false @@ -651,7 +660,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -700,7 +709,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt PetApiService uploads an image (required) * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update - * @param file file to upload + * @param requiredFile file to upload * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server @return ApiResponse @@ -710,12 +719,13 @@ type UploadFileWithRequiredFileOpts struct { AdditionalMetadata optional.String } -func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, file *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue ApiResponse ) @@ -747,14 +757,15 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) } - localVarFile := file + localVarFormFileName = "requiredFile" + localVarFile := requiredFile if localVarFile != nil { fbs, _ := ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index e628e13428..d03e97a27d 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -34,9 +34,10 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -64,7 +65,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -100,9 +101,10 @@ Returns a map of status codes to quantities func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue map[string]int32 ) @@ -143,7 +145,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -198,9 +200,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other val func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Order ) @@ -235,7 +238,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -289,9 +292,10 @@ StoreApiService Place an order for a pet func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Order ) @@ -321,7 +325,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, * } // body params localVarPostBody = &order - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index c24eeacc70..e8fbe7bef0 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -34,9 +34,10 @@ This can only be done by the logged in user. func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -65,7 +66,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Respo } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -100,9 +101,10 @@ UserApiService Creates list of users with given input array func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -131,7 +133,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []U } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -166,9 +168,10 @@ UserApiService Creates list of users with given input array func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -197,7 +200,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []Us } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -233,9 +236,10 @@ This can only be done by the logged in user. func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -263,7 +267,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -299,9 +303,10 @@ UserApiService Get user by user name func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue User ) @@ -330,7 +335,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -385,9 +390,10 @@ UserApiService Logs user into the system func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue string ) @@ -417,7 +423,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -469,9 +475,10 @@ UserApiService Logs out current logged in user session func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -498,7 +505,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -535,9 +542,10 @@ This can only be done by the logged in user. func (a *UserApiService) UpdateUser(ctx context.Context, username string, user User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -567,7 +575,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, user U } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index bae1cc29b0..a51675e447 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -178,6 +178,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, + formFileName string, fileName string, fileBytes []byte) (localVarRequest *http.Request, err error) { @@ -220,7 +221,7 @@ func (c *APIClient) prepareRequest( if len(fileBytes) > 0 && fileName != "" { w.Boundary() //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile("file", filepath.Base(fileName)) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) if err != nil { return nil, err } diff --git a/samples/client/petstore/go/go-petstore/docs/PetApi.md b/samples/client/petstore/go/go-petstore/docs/PetApi.md index 327cc1739c..481ce5e80e 100644 --- a/samples/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore/docs/PetApi.md @@ -259,7 +259,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **UploadFileWithRequiredFile** -> ApiResponse UploadFileWithRequiredFile(ctx, petId, file, optional) +> ApiResponse UploadFileWithRequiredFile(ctx, petId, requiredFile, optional) uploads an image (required) ### Required Parameters @@ -268,7 +268,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **petId** | **int64**| ID of pet to update | - **file** | ***os.File*****os.File**| file to upload | + **requiredFile** | ***os.File*****os.File**| file to upload | **optional** | ***UploadFileWithRequiredFileOpts** | optional parameters | nil if no parameters ### Optional Parameters diff --git a/samples/client/petstore/go/go-petstore/model_file.go b/samples/client/petstore/go/go-petstore/model_file.go index e8c95c5043..2782ccc9a2 100644 --- a/samples/client/petstore/go/go-petstore/model_file.go +++ b/samples/client/petstore/go/go-petstore/model_file.go @@ -9,6 +9,7 @@ package petstore +// Must be named `File` for test. type File struct { // Test capitalization SourceURI string `json:"sourceURI,omitempty"` diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/PetApi.java index c96556b8bd..e7c2ded72f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/PetApi.java @@ -187,7 +187,7 @@ public interface PetApi extends ApiClient.Api { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse */ @@ -196,5 +196,5 @@ public interface PetApi extends ApiClient.Api { "Content-Type: multipart/form-data", "Accept: application/json", }) - ModelApiResponse uploadFileWithRequiredFile(@Param("petId") Long petId, @Param("file") File file, @Param("additionalMetadata") String additionalMetadata); + ModelApiResponse uploadFileWithRequiredFile(@Param("petId") Long petId, @Param("requiredFile") File requiredFile, @Param("additionalMetadata") String additionalMetadata); } diff --git a/samples/client/petstore/java/google-api-client/docs/PetApi.md b/samples/client/petstore/java/google-api-client/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/google-api-client/docs/PetApi.md +++ b/samples/client/petstore/java/google-api-client/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java index 4050796041..8691400482 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java @@ -719,13 +719,13 @@ public class PetApi { * uploads an image (required) *

200 - successful operation * @param petId ID of pet to update - * @param file file to upload + * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server * @return ModelApiResponse * @throws IOException if an error occurs while attempting to invoke the API **/ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws IOException { - HttpResponse response = uploadFileWithRequiredFileForHttpResponse(petId, file, additionalMetadata); + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws IOException { + HttpResponse response = uploadFileWithRequiredFileForHttpResponse(petId, requiredFile, additionalMetadata); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } @@ -734,24 +734,24 @@ public class PetApi { * uploads an image (required) *

200 - successful operation * @param petId ID of pet to update - * @param file file to upload + * @param requiredFile file to upload * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return ModelApiResponse * @throws IOException if an error occurs while attempting to invoke the API **/ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, Map params) throws IOException { - HttpResponse response = uploadFileWithRequiredFileForHttpResponse(petId, file, params); + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, Map params) throws IOException { + HttpResponse response = uploadFileWithRequiredFileForHttpResponse(petId, requiredFile, params); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File file, String additionalMetadata) throws IOException { + public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File requiredFile, String additionalMetadata) throws IOException { // verify the required parameter 'petId' is set if (petId == null) { throw new IllegalArgumentException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); - }// verify the required parameter 'file' is set - if (file == null) { - throw new IllegalArgumentException("Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + }// verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new IllegalArgumentException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create a map of path variables final Map uriVariables = new HashMap(); @@ -765,13 +765,13 @@ public class PetApi { return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File file, Map params) throws IOException { + public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File requiredFile, Map params) throws IOException { // verify the required parameter 'petId' is set if (petId == null) { throw new IllegalArgumentException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); - }// verify the required parameter 'file' is set - if (file == null) { - throw new IllegalArgumentException("Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + }// verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new IllegalArgumentException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create a map of path variables final Map uriVariables = new HashMap(); diff --git a/samples/client/petstore/java/jersey1/docs/PetApi.md b/samples/client/petstore/java/jersey1/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/jersey1/docs/PetApi.md +++ b/samples/client/petstore/java/jersey1/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/PetApi.java index 520f7a9843..95440adf04 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/PetApi.java @@ -409,12 +409,12 @@ if (file != null) * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws ApiException { + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -422,9 +422,9 @@ if (file != null) throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new ApiException(400, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create path and map variables @@ -441,8 +441,8 @@ if (file != null) if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); +if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); final String[] localVarAccepts = { "application/json" diff --git a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java index 7b381aa600..0af6b7ce7b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java @@ -483,25 +483,25 @@ if (file != null) * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws ApiException { - return uploadFileWithRequiredFileWithHttpInfo(petId, file, additionalMetadata).getData(); + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata).getData(); } /** * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File file, String additionalMetadata) throws ApiException { + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { Object localVarPostBody = new Object(); // verify the required parameter 'petId' is set @@ -509,9 +509,9 @@ if (file != null) throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new ApiException(400, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create path and map variables @@ -527,8 +527,8 @@ if (file != null) if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); +if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); final String[] localVarAccepts = { "application/json" diff --git a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java index 7b381aa600..0af6b7ce7b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java @@ -483,25 +483,25 @@ if (file != null) * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws ApiException { - return uploadFileWithRequiredFileWithHttpInfo(petId, file, additionalMetadata).getData(); + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata).getData(); } /** * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File file, String additionalMetadata) throws ApiException { + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { Object localVarPostBody = new Object(); // verify the required parameter 'petId' is set @@ -509,9 +509,9 @@ if (file != null) throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new ApiException(400, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create path and map variables @@ -527,8 +527,8 @@ if (file != null) if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); +if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); final String[] localVarAccepts = { "application/json" diff --git a/samples/client/petstore/java/jersey2/docs/PetApi.md b/samples/client/petstore/java/jersey2/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/jersey2/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java index 7b381aa600..0af6b7ce7b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java @@ -483,25 +483,25 @@ if (file != null) * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws ApiException { - return uploadFileWithRequiredFileWithHttpInfo(petId, file, additionalMetadata).getData(); + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata).getData(); } /** * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File file, String additionalMetadata) throws ApiException { + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { Object localVarPostBody = new Object(); // verify the required parameter 'petId' is set @@ -509,9 +509,9 @@ if (file != null) throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new ApiException(400, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create path and map variables @@ -527,8 +527,8 @@ if (file != null) if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); +if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); final String[] localVarAccepts = { "application/json" diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index 7683193374..d1b477e0d4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -1066,14 +1066,14 @@ public class PetApi { /** * Build call for uploadFileWithRequiredFile * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - public com.squareup.okhttp.Call uploadFileWithRequiredFileCall(Long petId, File file, String additionalMetadata, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = new Object(); // create path and map variables @@ -1088,8 +1088,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); - if (file != null) - localVarFormParams.put("file", file); + if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); final String[] localVarAccepts = { "application/json" @@ -1120,20 +1120,20 @@ public class PetApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File file, String additionalMetadata, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File requiredFile, String additionalMetadata, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile(Async)"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new ApiException("Missing the required parameter 'file' when calling uploadFileWithRequiredFile(Async)"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile(Async)"); } - com.squareup.okhttp.Call call = uploadFileWithRequiredFileCall(petId, file, additionalMetadata, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, progressListener, progressRequestListener); return call; } @@ -1142,13 +1142,13 @@ public class PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws ApiException { - ApiResponse resp = uploadFileWithRequiredFileWithHttpInfo(petId, file, additionalMetadata); + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + ApiResponse resp = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); return resp.getData(); } @@ -1156,13 +1156,13 @@ public class PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ApiResponse<ModelApiResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File file, String additionalMetadata) throws ApiException { - com.squareup.okhttp.Call call = uploadFileWithRequiredFileValidateBeforeCall(petId, file, additionalMetadata, null, null); + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + com.squareup.okhttp.Call call = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -1171,13 +1171,13 @@ public class PetApi { * uploads an image (required) (asynchronously) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call uploadFileWithRequiredFileAsync(Long petId, File file, String additionalMetadata, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call uploadFileWithRequiredFileAsync(Long petId, File requiredFile, String additionalMetadata, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1198,7 +1198,7 @@ public class PetApi { }; } - com.squareup.okhttp.Call call = uploadFileWithRequiredFileValidateBeforeCall(petId, file, additionalMetadata, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; diff --git a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index 7683193374..d1b477e0d4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -1066,14 +1066,14 @@ public class PetApi { /** * Build call for uploadFileWithRequiredFile * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - public com.squareup.okhttp.Call uploadFileWithRequiredFileCall(Long petId, File file, String additionalMetadata, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = new Object(); // create path and map variables @@ -1088,8 +1088,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); - if (file != null) - localVarFormParams.put("file", file); + if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); final String[] localVarAccepts = { "application/json" @@ -1120,20 +1120,20 @@ public class PetApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File file, String additionalMetadata, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File requiredFile, String additionalMetadata, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile(Async)"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new ApiException("Missing the required parameter 'file' when calling uploadFileWithRequiredFile(Async)"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile(Async)"); } - com.squareup.okhttp.Call call = uploadFileWithRequiredFileCall(petId, file, additionalMetadata, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, progressListener, progressRequestListener); return call; } @@ -1142,13 +1142,13 @@ public class PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws ApiException { - ApiResponse resp = uploadFileWithRequiredFileWithHttpInfo(petId, file, additionalMetadata); + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + ApiResponse resp = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); return resp.getData(); } @@ -1156,13 +1156,13 @@ public class PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ApiResponse<ModelApiResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File file, String additionalMetadata) throws ApiException { - com.squareup.okhttp.Call call = uploadFileWithRequiredFileValidateBeforeCall(petId, file, additionalMetadata, null, null); + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + com.squareup.okhttp.Call call = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -1171,13 +1171,13 @@ public class PetApi { * uploads an image (required) (asynchronously) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call uploadFileWithRequiredFileAsync(Long petId, File file, String additionalMetadata, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call uploadFileWithRequiredFileAsync(Long petId, File requiredFile, String additionalMetadata, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1198,7 +1198,7 @@ public class PetApi { }; } - com.squareup.okhttp.Call call = uploadFileWithRequiredFileValidateBeforeCall(petId, file, additionalMetadata, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; diff --git a/samples/client/petstore/java/rest-assured/docs/PetApi.md b/samples/client/petstore/java/rest-assured/docs/PetApi.md index c61ebe262e..46c4d12008 100644 --- a/samples/client/petstore/java/rest-assured/docs/PetApi.md +++ b/samples/client/petstore/java/rest-assured/docs/PetApi.md @@ -348,7 +348,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -365,7 +365,7 @@ PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( api.uploadFileWithRequiredFile() .petIdPath(petId) - .fileMultiPart(file).execute(r -> r.prettyPeek()); + .requiredFileMultiPart(requiredFile).execute(r -> r.prettyPeek()); ``` ### Parameters @@ -373,7 +373,7 @@ api.uploadFileWithRequiredFile() Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java index f8c8533b38..6df8c7098d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java @@ -747,7 +747,7 @@ public class PetApi { * * * @see #petIdPath ID of pet to update (required) - * @see #fileMultiPart file to upload (required) + * @see #requiredFileMultiPart file to upload (required) * @see #additionalMetadataForm Additional data to pass to server (optional, default to null) * return ModelApiResponse */ @@ -818,11 +818,11 @@ public class PetApi { /** * It will assume that the control name is file and the <content-type> is <application/octet-stream> * @see #reqSpec for customise - * @param file (File) file to upload (required) + * @param requiredFile (File) file to upload (required) * @return operation */ - public UploadFileWithRequiredFileOper fileMultiPart(File file) { - reqSpec.addMultiPart(file); + public UploadFileWithRequiredFileOper requiredFileMultiPart(File requiredFile) { + reqSpec.addMultiPart(requiredFile); return this; } diff --git a/samples/client/petstore/java/resteasy/docs/PetApi.md b/samples/client/petstore/java/resteasy/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/resteasy/docs/PetApi.md +++ b/samples/client/petstore/java/resteasy/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java index 2cffbb8a9b..98ef7b101c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java @@ -387,12 +387,12 @@ if (file != null) * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return a {@code ModelApiResponse} * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws ApiException { + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { Object localVarPostBody = new Object(); // verify the required parameter 'petId' is set @@ -400,9 +400,9 @@ if (file != null) throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new ApiException(400, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create path and map variables @@ -418,8 +418,8 @@ if (file != null) if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); +if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); final String[] localVarAccepts = { "application/json" diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java index 3161a9ee5e..8a9eeaa82c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java @@ -360,12 +360,12 @@ public class PetApi { * *

200 - successful operation * @param petId ID of pet to update - * @param file file to upload + * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server * @return ModelApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws RestClientException { + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientException { Object postBody = new Object(); // verify the required parameter 'petId' is set @@ -373,9 +373,9 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create path and map variables @@ -389,8 +389,8 @@ public class PetApi { if (additionalMetadata != null) formParams.add("additionalMetadata", additionalMetadata); - if (file != null) - formParams.add("file", new FileSystemResource(file)); + if (requiredFile != null) + formParams.add("requiredFile", new FileSystemResource(requiredFile)); final String[] accepts = { "application/json" diff --git a/samples/client/petstore/java/resttemplate/docs/PetApi.md b/samples/client/petstore/java/resttemplate/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/resttemplate/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java index 3161a9ee5e..8a9eeaa82c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java @@ -360,12 +360,12 @@ public class PetApi { * *

200 - successful operation * @param petId ID of pet to update - * @param file file to upload + * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server * @return ModelApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws RestClientException { + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientException { Object postBody = new Object(); // verify the required parameter 'petId' is set @@ -373,9 +373,9 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create path and map variables @@ -389,8 +389,8 @@ public class PetApi { if (additionalMetadata != null) formParams.add("additionalMetadata", additionalMetadata); - if (file != null) - formParams.add("file", new FileSystemResource(file)); + if (requiredFile != null) + formParams.add("requiredFile", new FileSystemResource(requiredFile)); final String[] accepts = { "application/json" diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/PetApi.java index e7ccda2dc6..bfe54c86bd 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/PetApi.java @@ -227,7 +227,7 @@ public interface PetApi { * Sync method * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse */ @@ -235,14 +235,14 @@ public interface PetApi { @retrofit.http.Multipart @POST("/fake/{petId}/uploadImageWithRequiredFile") ModelApiResponse uploadFileWithRequiredFile( - @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("file") TypedFile file, @retrofit.http.Part("additionalMetadata") String additionalMetadata + @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("requiredFile") TypedFile requiredFile, @retrofit.http.Part("additionalMetadata") String additionalMetadata ); /** * uploads an image (required) * Async method * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @param cb callback method */ @@ -250,6 +250,6 @@ public interface PetApi { @retrofit.http.Multipart @POST("/fake/{petId}/uploadImageWithRequiredFile") void uploadFileWithRequiredFile( - @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("file") TypedFile file, @retrofit.http.Part("additionalMetadata") String additionalMetadata, Callback cb + @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("requiredFile") TypedFile requiredFile, @retrofit.http.Part("additionalMetadata") String additionalMetadata, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md index 88e229bd8e..0005f28329 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/PetApi.java index dc1c0df8ce..9e4ac61bd8 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/PetApi.java @@ -129,14 +129,14 @@ public interface PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return Call<ModelApiResponse> */ @retrofit2.http.Multipart @POST("fake/{petId}/uploadImageWithRequiredFile") F.Promise> uploadFileWithRequiredFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("file") MultipartBody.Part file, @retrofit2.http.Part("additionalMetadata") String additionalMetadata + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("requiredFile") MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata ); } diff --git a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md index 88e229bd8e..0005f28329 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/PetApi.java index d3e7d96bfb..75fff9f67c 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/PetApi.java @@ -129,14 +129,14 @@ public interface PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return Call<ModelApiResponse> */ @retrofit2.http.Multipart @POST("fake/{petId}/uploadImageWithRequiredFile") CompletionStage> uploadFileWithRequiredFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("file") MultipartBody.Part file, @retrofit2.http.Part("additionalMetadata") String additionalMetadata + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("requiredFile") MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata ); } diff --git a/samples/client/petstore/java/retrofit2/docs/PetApi.md b/samples/client/petstore/java/retrofit2/docs/PetApi.md index 88e229bd8e..0005f28329 100644 --- a/samples/client/petstore/java/retrofit2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java index bd41997b4e..861c810234 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java @@ -126,14 +126,14 @@ public interface PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return Call<ModelApiResponse> */ @retrofit2.http.Multipart @POST("fake/{petId}/uploadImageWithRequiredFile") Call uploadFileWithRequiredFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("file") MultipartBody.Part file, @retrofit2.http.Part("additionalMetadata") String additionalMetadata + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("requiredFile") MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata ); } diff --git a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md index 88e229bd8e..0005f28329 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/PetApi.java index e60b78d8ae..6258d82a58 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/PetApi.java @@ -126,14 +126,14 @@ public interface PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return Observable<ModelApiResponse> */ @retrofit2.http.Multipart @POST("fake/{petId}/uploadImageWithRequiredFile") Observable uploadFileWithRequiredFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("file") MultipartBody.Part file, @retrofit2.http.Part("additionalMetadata") String additionalMetadata + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("requiredFile") MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata ); } diff --git a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md index 88e229bd8e..0005f28329 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java index cc94ec8358..bb0b709561 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java @@ -127,14 +127,14 @@ public interface PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return Observable<ModelApiResponse> */ @retrofit2.http.Multipart @POST("fake/{petId}/uploadImageWithRequiredFile") Observable uploadFileWithRequiredFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("file") MultipartBody.Part file, @retrofit2.http.Part("additionalMetadata") String additionalMetadata + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("requiredFile") MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata ); } diff --git a/samples/client/petstore/java/vertx/docs/PetApi.md b/samples/client/petstore/java/vertx/docs/PetApi.md index 0cd9ccd833..0bb5e1de8e 100644 --- a/samples/client/petstore/java/vertx/docs/PetApi.md +++ b/samples/client/petstore/java/vertx/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -AsyncFile file = new AsyncFile(); // AsyncFile | file to upload +AsyncFile requiredFile = new AsyncFile(); // AsyncFile | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **AsyncFile**| file to upload | [default to null] + **requiredFile** | **AsyncFile**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java index 817a544ea7..eb0cd44f8c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java @@ -27,6 +27,6 @@ public interface PetApi { void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Handler> handler); - void uploadFileWithRequiredFile(Long petId, AsyncFile file, String additionalMetadata, Handler> handler); + void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, Handler> handler); } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java index 58ba182d7d..8d14ef03ba 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java @@ -328,11 +328,11 @@ if (file != null) localVarFormParams.put("file", file); * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @param resultHandler Asynchronous result handler */ - public void uploadFileWithRequiredFile(Long petId, AsyncFile file, String additionalMetadata, Handler> resultHandler) { + public void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'petId' is set @@ -341,9 +341,9 @@ if (file != null) localVarFormParams.put("file", file); return; } - // verify the required parameter 'file' is set - if (file == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile")); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile")); return; } @@ -360,7 +360,7 @@ if (file != null) localVarFormParams.put("file", file); // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) localVarFormParams.put("file", file); +if (requiredFile != null) localVarFormParams.put("requiredFile", requiredFile); String[] localVarAccepts = { "application/json" }; String[] localVarContentTypes = { "multipart/form-data" }; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java index 7edbd19f50..dcdd28e163 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java @@ -205,25 +205,25 @@ public class PetApi { * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @param resultHandler Asynchronous result handler */ - public void uploadFileWithRequiredFile(Long petId, AsyncFile file, String additionalMetadata, Handler> resultHandler) { - delegate.uploadFileWithRequiredFile(petId, file, additionalMetadata, resultHandler); + public void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, Handler> resultHandler) { + delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, resultHandler); } /** * uploads an image (required) * * @param petId ID of pet to update (required) - * @param file file to upload (required) + * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return Asynchronous result handler (RxJava Single) */ - public Single rxUploadFileWithRequiredFile(Long petId, AsyncFile file, String additionalMetadata) { + public Single rxUploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.uploadFileWithRequiredFile(petId, file, additionalMetadata, fut); + delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, fut); })); } diff --git a/samples/client/petstore/java/webclient/docs/PetApi.md b/samples/client/petstore/java/webclient/docs/PetApi.md index dd4224a902..41c08ccf9e 100644 --- a/samples/client/petstore/java/webclient/docs/PetApi.md +++ b/samples/client/petstore/java/webclient/docs/PetApi.md @@ -439,7 +439,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -460,10 +460,10 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Long petId = 56L; // Long | ID of pet to update -File file = new File("null"); // File | file to upload +File requiredFile = new File("null"); // File | file to upload String additionalMetadata = "null"; // String | Additional data to pass to server try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -476,7 +476,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | - **file** | **File**| file to upload | [default to null] + **requiredFile** | **File**| file to upload | [default to null] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java index f75bef47f0..92bfbd46d5 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -360,12 +360,12 @@ public class PetApi { * *

200 - successful operation * @param petId ID of pet to update - * @param file file to upload + * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server * @return ModelApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Mono uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws RestClientException { + public Mono uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientException { Object postBody = null; // verify the required parameter 'petId' is set @@ -373,9 +373,9 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'file' is set - if (file == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } // create path and map variables @@ -389,8 +389,8 @@ public class PetApi { if (additionalMetadata != null) formParams.add("additionalMetadata", additionalMetadata); - if (file != null) - formParams.add("file", new FileSystemResource(file)); + if (requiredFile != null) + formParams.add("requiredFile", new FileSystemResource(requiredFile)); final String[] accepts = { "application/json" diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md index 647d70aae9..ebd48de8fe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md @@ -438,7 +438,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **uploadFileWithRequiredFile** -> \OpenAPI\Client\Model\ApiResponse uploadFileWithRequiredFile($pet_id, $file, $additional_metadata) +> \OpenAPI\Client\Model\ApiResponse uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata) uploads an image (required) @@ -457,11 +457,11 @@ $apiInstance = new OpenAPI\Client\Api\PetApi( $config ); $pet_id = 56; // int | ID of pet to update -$file = "/path/to/file.txt"; // \SplFileObject | file to upload +$required_file = "/path/to/file.txt"; // \SplFileObject | file to upload $additional_metadata = 'additional_metadata_example'; // string | Additional data to pass to server try { - $result = $apiInstance->uploadFileWithRequiredFile($pet_id, $file, $additional_metadata); + $result = $apiInstance->uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata); print_r($result); } catch (Exception $e) { echo 'Exception when calling PetApi->uploadFileWithRequiredFile: ', $e->getMessage(), PHP_EOL; @@ -474,7 +474,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet to update | - **file** | **\SplFileObject****\SplFileObject**| file to upload | + **required_file** | **\SplFileObject****\SplFileObject**| file to upload | **additional_metadata** | **string**| Additional data to pass to server | [optional] ### Return type diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 5e5545ebfa..16a942f882 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -2180,16 +2180,16 @@ class PetApi * uploads an image (required) * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ApiResponse */ - public function uploadFileWithRequiredFile($pet_id, $file, $additional_metadata = null) + public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata = null) { - list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $file, $additional_metadata); + list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata); return $response; } @@ -2199,16 +2199,16 @@ class PetApi * uploads an image (required) * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $file, $additional_metadata = null) + public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata = null) { - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $file, $additional_metadata); + $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); try { $options = $this->createHttpClientOption(); @@ -2295,15 +2295,15 @@ class PetApi * uploads an image (required) * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsync($pet_id, $file, $additional_metadata = null) + public function uploadFileWithRequiredFileAsync($pet_id, $required_file, $additional_metadata = null) { - return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $file, $additional_metadata) + return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata) ->then( function ($response) { return $response[0]; @@ -2317,16 +2317,16 @@ class PetApi * uploads an image (required) * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $file, $additional_metadata = null) + public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata = null) { $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $file, $additional_metadata); + $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2369,13 +2369,13 @@ class PetApi * Create request for operation 'uploadFileWithRequiredFile' * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function uploadFileWithRequiredFileRequest($pet_id, $file, $additional_metadata = null) + protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null) { // verify the required parameter 'pet_id' is set if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { @@ -2383,10 +2383,10 @@ class PetApi 'Missing the required parameter $pet_id when calling uploadFileWithRequiredFile' ); } - // verify the required parameter 'file' is set - if ($file === null || (is_array($file) && count($file) === 0)) { + // verify the required parameter 'required_file' is set + if ($required_file === null || (is_array($required_file) && count($required_file) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $file when calling uploadFileWithRequiredFile' + 'Missing the required parameter $required_file when calling uploadFileWithRequiredFile' ); } @@ -2412,9 +2412,9 @@ class PetApi $formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata); } // form params - if ($file !== null) { + if ($required_file !== null) { $multipart = true; - $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); + $formParams['requiredFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($required_file), 'rb'); } // body params $_tempBody = null; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 542e203482..256b4a93c6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -36,6 +36,7 @@ use \OpenAPI\Client\ObjectSerializer; * File Class Doc Comment * * @category Class + * @description Must be named `File` for test. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index 7d3dd69ef0..2aec012c9b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -33,7 +33,7 @@ namespace OpenAPI\Client; * FileTest Class Doc Comment * * @category Class - * @description File + * @description Must be named `File` for test. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index 60a4bc68d1..61adf80830 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -420,7 +420,7 @@ Name | Type | Description | Notes # **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, file, opts) +> ApiResponse upload_file_with_required_file(pet_id, required_file, opts) uploads an image (required) @@ -436,14 +436,14 @@ end api_instance = Petstore::PetApi.new pet_id = 56 # Integer | ID of pet to update -file = File.new('/path/to/file') # File | file to upload +required_file = File.new('/path/to/file') # File | file to upload opts = { additional_metadata: 'additional_metadata_example' # String | Additional data to pass to server } begin #uploads an image (required) - result = api_instance.upload_file_with_required_file(pet_id, file, opts) + result = api_instance.upload_file_with_required_file(pet_id, required_file, opts) p result rescue Petstore::ApiError => e puts "Exception when calling PetApi->upload_file_with_required_file: #{e}" @@ -455,7 +455,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **Integer**| ID of pet to update | - **file** | **File**| file to upload | + **required_file** | **File**| file to upload | **additional_metadata** | **String**| Additional data to pass to server | [optional] ### Return type diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index f210c2ee80..b748988391 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -440,22 +440,22 @@ module Petstore end # uploads an image (required) # @param pet_id ID of pet to update - # @param file file to upload + # @param required_file file to upload # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server # @return [ApiResponse] - def upload_file_with_required_file(pet_id, file, opts = {}) - data, _status_code, _headers = upload_file_with_required_file_with_http_info(pet_id, file, opts) + def upload_file_with_required_file(pet_id, required_file, opts = {}) + data, _status_code, _headers = upload_file_with_required_file_with_http_info(pet_id, required_file, opts) data end # uploads an image (required) # @param pet_id ID of pet to update - # @param file file to upload + # @param required_file file to upload # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server # @return [Array<(ApiResponse, Fixnum, Hash)>] ApiResponse data, response status code and response headers - def upload_file_with_required_file_with_http_info(pet_id, file, opts = {}) + def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.upload_file_with_required_file ...' end @@ -463,9 +463,9 @@ module Petstore if @api_client.config.client_side_validation && pet_id.nil? fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file_with_required_file" end - # verify the required parameter 'file' is set - if @api_client.config.client_side_validation && file.nil? - fail ArgumentError, "Missing the required parameter 'file' when calling PetApi.upload_file_with_required_file" + # verify the required parameter 'required_file' is set + if @api_client.config.client_side_validation && required_file.nil? + fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" end # resource path local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', pet_id.to_s) @@ -482,7 +482,7 @@ module Petstore # form parameters form_params = {} - form_params['file'] = file + form_params['requiredFile'] = required_file form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? # http body (model) diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index ed1de2b507..a6af87afb7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -13,6 +13,7 @@ OpenAPI Generator version: 3.1.1-SNAPSHOT require 'date' module Petstore + # Must be named `File` for test. class File # Test capitalization attr_accessor :source_uri diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md index 647d70aae9..ebd48de8fe 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md @@ -438,7 +438,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **uploadFileWithRequiredFile** -> \OpenAPI\Client\Model\ApiResponse uploadFileWithRequiredFile($pet_id, $file, $additional_metadata) +> \OpenAPI\Client\Model\ApiResponse uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata) uploads an image (required) @@ -457,11 +457,11 @@ $apiInstance = new OpenAPI\Client\Api\PetApi( $config ); $pet_id = 56; // int | ID of pet to update -$file = "/path/to/file.txt"; // \SplFileObject | file to upload +$required_file = "/path/to/file.txt"; // \SplFileObject | file to upload $additional_metadata = 'additional_metadata_example'; // string | Additional data to pass to server try { - $result = $apiInstance->uploadFileWithRequiredFile($pet_id, $file, $additional_metadata); + $result = $apiInstance->uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata); print_r($result); } catch (Exception $e) { echo 'Exception when calling PetApi->uploadFileWithRequiredFile: ', $e->getMessage(), PHP_EOL; @@ -474,7 +474,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet to update | - **file** | **\SplFileObject****\SplFileObject**| file to upload | + **required_file** | **\SplFileObject****\SplFileObject**| file to upload | **additional_metadata** | **string**| Additional data to pass to server | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 5e5545ebfa..16a942f882 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -2180,16 +2180,16 @@ class PetApi * uploads an image (required) * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ApiResponse */ - public function uploadFileWithRequiredFile($pet_id, $file, $additional_metadata = null) + public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata = null) { - list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $file, $additional_metadata); + list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata); return $response; } @@ -2199,16 +2199,16 @@ class PetApi * uploads an image (required) * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $file, $additional_metadata = null) + public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata = null) { - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $file, $additional_metadata); + $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); try { $options = $this->createHttpClientOption(); @@ -2295,15 +2295,15 @@ class PetApi * uploads an image (required) * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsync($pet_id, $file, $additional_metadata = null) + public function uploadFileWithRequiredFileAsync($pet_id, $required_file, $additional_metadata = null) { - return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $file, $additional_metadata) + return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata) ->then( function ($response) { return $response[0]; @@ -2317,16 +2317,16 @@ class PetApi * uploads an image (required) * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $file, $additional_metadata = null) + public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata = null) { $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $file, $additional_metadata); + $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2369,13 +2369,13 @@ class PetApi * Create request for operation 'uploadFileWithRequiredFile' * * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $file file to upload (required) + * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function uploadFileWithRequiredFileRequest($pet_id, $file, $additional_metadata = null) + protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null) { // verify the required parameter 'pet_id' is set if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { @@ -2383,10 +2383,10 @@ class PetApi 'Missing the required parameter $pet_id when calling uploadFileWithRequiredFile' ); } - // verify the required parameter 'file' is set - if ($file === null || (is_array($file) && count($file) === 0)) { + // verify the required parameter 'required_file' is set + if ($required_file === null || (is_array($required_file) && count($required_file) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $file when calling uploadFileWithRequiredFile' + 'Missing the required parameter $required_file when calling uploadFileWithRequiredFile' ); } @@ -2412,9 +2412,9 @@ class PetApi $formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata); } // form params - if ($file !== null) { + if ($required_file !== null) { $multipart = true; - $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); + $formParams['requiredFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($required_file), 'rb'); } // body params $_tempBody = null; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java index 7010ca7717..d32fbdd1b0 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java @@ -150,6 +150,6 @@ public interface PetApi { @ApiOperation(value = "uploads an image (required)", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @Multipart(value = "file" ) Attachment fileDetail, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata); + public ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @Multipart(value = "requiredFile" ) Attachment requiredFileDetail, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata); } diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 949a6bf700..32e51d860c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -115,7 +115,7 @@ public class PetApiServiceImpl implements PetApi { * uploads an image (required) * */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, Attachment fileDetail, String additionalMetadata) { + public ModelApiResponse uploadFileWithRequiredFile(Long petId, Attachment requiredFileDetail, String additionalMetadata) { // TODO: Implement... return null; diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java index 3fc88b894d..aaa3b2dfc5 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java @@ -221,9 +221,9 @@ public class PetApiTest { @Test public void uploadFileWithRequiredFileTest() { Long petId = null; - org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; + org.apache.cxf.jaxrs.ext.multipart.Attachment requiredFile = null; String additionalMetadata = null; - //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, file, additionalMetadata); + //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java index dd25da0dec..ddcc88022f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java @@ -239,11 +239,11 @@ public class FakeApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId , - @FormDataParam("file") InputStream fileInputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail + @FormDataParam("requiredFile") InputStream requiredFileInputStream, + @FormDataParam("requiredFile") FormDataContentDisposition requiredFileDetail ,@ApiParam(value = "Additional data to pass to server", defaultValue="null")@FormDataParam("additionalMetadata") String additionalMetadata ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.uploadFileWithRequiredFile(petId,fileInputStream, fileDetail,additionalMetadata,securityContext); + return delegate.uploadFileWithRequiredFile(petId,requiredFileInputStream, requiredFileDetail,additionalMetadata,securityContext); } } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java index 5110fc0a45..3359bba810 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java @@ -37,5 +37,5 @@ public abstract class FakeApiService { public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; - public abstract Response uploadFileWithRequiredFile(Long petId,InputStream fileInputStream, FormDataContentDisposition fileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; + public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 1f1801941c..4ce7aadf70 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -82,7 +82,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response uploadFileWithRequiredFile(Long petId, InputStream fileInputStream, FormDataContentDisposition fileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { + public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java index 5f0f5cd335..20e3fa1229 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java @@ -128,6 +128,6 @@ public interface FakeApi { }, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail,@FormParam(value = "additionalMetadata") String additionalMetadata); + ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream, + @FormParam(value = "requiredFile") Attachment requiredFileDetail,@FormParam(value = "additionalMetadata") String additionalMetadata); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index d0d0a0f820..536d1d3912 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1074,12 +1074,12 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload format: binary type: string required: - - file + - requiredFile required: true responses: 200: @@ -1577,6 +1577,7 @@ components: $ref: '#/components/schemas/Animal' type: array File: + description: Must be named `File` for test. example: sourceURI: sourceURI properties: diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java index f3353c1b09..c575f781e0 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java @@ -162,8 +162,8 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFileWithRequiredFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail,@FormParam(value = "additionalMetadata") String additionalMetadata) { + public Response uploadFileWithRequiredFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream, + @FormParam(value = "requiredFile") Attachment requiredFileDetail,@FormParam(value = "additionalMetadata") String additionalMetadata) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index d0d0a0f820..536d1d3912 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1074,12 +1074,12 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload format: binary type: string required: - - file + - requiredFile required: true responses: 200: @@ -1577,6 +1577,7 @@ components: $ref: '#/components/schemas/Animal' type: array File: + description: Must be named `File` for test. example: sourceURI: sourceURI properties: diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java index 016e3761bf..47102e7b50 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -203,8 +203,8 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, - @FormDataParam("file") InputStream inputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail, + @FormDataParam("requiredFile") InputStream inputStream, + @FormDataParam("requiredFile") FormDataContentDisposition fileDetail, @FormDataParam("additionalMetadata") String additionalMetadata, @Context SecurityContext securityContext) throws NotFoundException { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApiService.java index ce8c271d31..989a929d2f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApiService.java @@ -38,6 +38,6 @@ public abstract class PetApiService { throws NotFoundException; public abstract Response uploadFile(Long petId,String additionalMetadata,InputStream fileInputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext) throws NotFoundException; - public abstract Response uploadFileWithRequiredFile(Long petId,InputStream fileInputStream, FormDataContentDisposition fileDetail,String additionalMetadata,SecurityContext securityContext) + public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index ade99c7c99..83f5058c7d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -71,7 +71,7 @@ public class PetApiServiceImpl extends PetApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response uploadFileWithRequiredFile(Long petId, InputStream fileInputStream, FormDataContentDisposition fileDetail, String additionalMetadata, SecurityContext securityContext) + public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java index f800889b90..04781547da 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java @@ -226,8 +226,8 @@ public class FakeApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, - @FormDataParam("file") InputStream inputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail, + @FormDataParam("requiredFile") InputStream inputStream, + @FormDataParam("requiredFile") FormDataContentDisposition fileDetail, @FormDataParam("additionalMetadata") String additionalMetadata, @Context SecurityContext securityContext) throws NotFoundException { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java index 8117156d3c..53d7685ed4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java @@ -50,6 +50,6 @@ public abstract class FakeApiService { throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; - public abstract Response uploadFileWithRequiredFile(Long petId,InputStream fileInputStream, FormDataContentDisposition fileDetail,String additionalMetadata,SecurityContext securityContext) + public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 13c42c45ae..7696e0d339 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -95,7 +95,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response uploadFileWithRequiredFile(Long petId, InputStream fileInputStream, FormDataContentDisposition fileDetail, String additionalMetadata, SecurityContext securityContext) + public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java index 0293ec5520..8d5362ac86 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -222,11 +222,11 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId , - @FormDataParam("file") InputStream fileInputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail + @FormDataParam("requiredFile") InputStream requiredFileInputStream, + @FormDataParam("requiredFile") FormDataContentDisposition requiredFileDetail ,@ApiParam(value = "Additional data to pass to server", defaultValue="null")@FormDataParam("additionalMetadata") String additionalMetadata ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.uploadFileWithRequiredFile(petId,fileInputStream, fileDetail,additionalMetadata,securityContext); + return delegate.uploadFileWithRequiredFile(petId,requiredFileInputStream, requiredFileDetail,additionalMetadata,securityContext); } } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java index 47299bb5da..2f468ca022 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java @@ -27,5 +27,5 @@ public abstract class PetApiService { public abstract Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException; public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFile(Long petId,String additionalMetadata,InputStream fileInputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext) throws NotFoundException; - public abstract Response uploadFileWithRequiredFile(Long petId,InputStream fileInputStream, FormDataContentDisposition fileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; + public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index b282f8833f..396eb0e24c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -60,7 +60,7 @@ public class PetApiServiceImpl extends PetApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response uploadFileWithRequiredFile(Long petId, InputStream fileInputStream, FormDataContentDisposition fileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { + public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java index 536daf4027..44a8201d93 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java @@ -238,11 +238,11 @@ public class FakeApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId , - @FormDataParam("file") InputStream fileInputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail + @FormDataParam("requiredFile") InputStream requiredFileInputStream, + @FormDataParam("requiredFile") FormDataContentDisposition requiredFileDetail ,@ApiParam(value = "Additional data to pass to server", defaultValue="null")@FormDataParam("additionalMetadata") String additionalMetadata ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.uploadFileWithRequiredFile(petId,fileInputStream, fileDetail,additionalMetadata,securityContext); + return delegate.uploadFileWithRequiredFile(petId,requiredFileInputStream, requiredFileDetail,additionalMetadata,securityContext); } } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java index 019512b90b..b4d3c8db5b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java @@ -36,5 +36,5 @@ public abstract class FakeApiService { public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; - public abstract Response uploadFileWithRequiredFile(Long petId,InputStream fileInputStream, FormDataContentDisposition fileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; + public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 6da7c0d4f5..18ba5cd2bd 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -81,7 +81,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response uploadFileWithRequiredFile(Long petId, InputStream fileInputStream, FormDataContentDisposition fileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { + public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 2b25d19a9a..ea0bebdb8f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -244,7 +244,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default CompletableFuture> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + default CompletableFuture> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index ee6ddb46fb..4c8b02da05 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -233,7 +233,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 9e84b94b51..6675dffdff 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -152,6 +152,6 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java index aee5905620..70ab648075 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java @@ -125,7 +125,7 @@ public class FakeApiController implements FakeApi { } - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 9e84b94b51..6675dffdff 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -152,6 +152,6 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index 70c075c24f..61c00424a1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -125,7 +125,7 @@ public class FakeApiController implements FakeApi { } - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 58d66356f1..7ecdac98da 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -178,8 +178,8 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { - return getDelegate().uploadFileWithRequiredFile(petId, file, additionalMetadata); + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index faf334f4c9..6dfe4160b1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -186,7 +186,7 @@ public interface FakeApiDelegate { * @see FakeApi#uploadFileWithRequiredFile */ default ResponseEntity uploadFileWithRequiredFile( Long petId, - MultipartFile file, + MultipartFile requiredFile, String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 9e84b94b51..6675dffdff 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -152,6 +152,6 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 54eb6561c7..55116d6a76 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -82,8 +82,8 @@ public class FakeApiController implements FakeApi { return delegate.testJsonFormData(param, param2); } - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { - return delegate.uploadFileWithRequiredFile(petId, file, additionalMetadata); + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index a121d339f6..48963d9526 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -105,7 +105,7 @@ public interface FakeApiDelegate { * @see FakeApi#uploadFileWithRequiredFile */ ResponseEntity uploadFileWithRequiredFile( Long petId, - MultipartFile file, + MultipartFile requiredFile, String additionalMetadata); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 91e9ddbf36..f958c39aaa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -259,7 +259,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index ef040b67b7..5e77ef342a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -237,7 +237,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, ServerWebExchange exchange) { + default ResponseEntity> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, ServerWebExchange exchange) { Mono result = Mono.empty(); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index 2bb74cd3d5..526dd125d8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1129,12 +1129,12 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload format: binary type: string required: - - file + - requiredFile required: true responses: 200: @@ -1634,6 +1634,7 @@ components: $ref: '#/components/schemas/Animal' type: array File: + description: Must be named `File` for test. example: sourceURI: sourceURI properties: diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 833ec0e887..e0fa901163 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -233,7 +233,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 60ed2a2c42..031c4c7394 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -233,7 +233,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {