diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index a8c7da4a34c2..f028d8d8b2d7 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -20,15 +20,15 @@ var ( type {{classname}}Service service {{#operation}} -/* -{{{classname}}}Service{{#summary}} {{.}}{{/summary}} +/* +{{{classname}}}Service{{#summary}} {{{.}}}{{/summary}} {{#notes}} {{notes}} {{/notes}} * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). {{#allParams}} {{#required}} - * @param {{paramName}}{{#description}} {{.}}{{/description}} + * @param {{paramName}}{{#description}} {{{.}}}{{/description}} {{/required}} {{/allParams}} {{#hasOptionalParams}} @@ -243,8 +243,12 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} } else { key = auth.Key } - {{#isKeyInHeader}}localVarHeaderParams["{{keyParamName}}"] = key{{/isKeyInHeader}} - {{#isKeyInQuery}}localVarQueryParams.Add("{{keyParamName}}", key){{/isKeyInQuery}} + {{#isKeyInHeader}} + localVarHeaderParams["{{keyParamName}}"] = key + {{/isKeyInHeader}} + {{#isKeyInQuery}} + localVarQueryParams.Add("{{keyParamName}}", key) + {{/isKeyInQuery}} } } @@ -270,7 +274,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, 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 53a15cad7521..9a665bd75758 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 @@ -272,43 +272,6 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' - '/pet/{petId}/uploadImageWithRequiredFile': - post: - tags: - - pet - summary: uploads an image - description: '' - operationId: uploadFileWithRequiredFile - consumes: - - multipart/form-data - produces: - - application/json - parameters: - - name: petId - in: path - description: ID of pet to update - required: true - type: integer - format: int64 - - name: additionalMetadata - in: formData - description: Additional data to pass to server - required: false - type: string - - name: file - in: formData - description: file to upload - required: true - type: file - responses: - '200': - description: successful operation - schema: - $ref: '#/definitions/ApiResponse' - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' /store/inventory: get: tags: @@ -984,6 +947,43 @@ paths: description: successful operation schema: $ref: '#/definitions/Client' + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + consumes: + - multipart/form-data + produces: + - application/json + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + type: integer + format: int64 + - name: additionalMetadata + in: formData + description: Additional data to pass to server + required: false + type: string + - name: file + in: formData + description: file to upload + required: true + type: file + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' securityDefinitions: petstore_auth: type: oauth2 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 3989ad4f0b97..ff9172b3122a 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 @@ -67,6 +67,7 @@ paths: description: Status values that need to be considered for filter required: true style: form + explode: false schema: type: array items: @@ -111,6 +112,7 @@ paths: description: Tags to filter by required: true style: form + explode: false schema: type: array items: @@ -265,47 +267,6 @@ paths: description: file to upload type: string format: binary - '/pet/{petId}/uploadImageWithRequiredFile': - post: - tags: - - pet - summary: uploads an image - description: '' - operationId: uploadFileWithRequiredFile - parameters: - - name: petId - in: path - description: ID of pet to update - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - type: string - format: binary - required: - - file /store/inventory: get: tags: @@ -612,6 +573,7 @@ paths: parameters: - name: enum_header_string_array in: header + explode: true description: Header parameter enum test (string array) schema: type: array @@ -950,6 +912,47 @@ paths: $ref: '#/components/schemas/Client' requestBody: $ref: '#/components/requestBodies/Client' + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + required: + - file components: requestBodies: UserArray: diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION index 82602aa4190d..0628777500bd 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.3-SNAPSHOT \ No newline at end of file +3.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore-withXml/README.md b/samples/client/petstore/go/go-petstore-withXml/README.md index dfb07bd7fdf6..55cb462ef068 100644 --- a/samples/client/petstore/go/go-petstore-withXml/README.md +++ b/samples/client/petstore/go/go-petstore-withXml/README.md @@ -50,6 +50,7 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status *StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID @@ -97,6 +98,7 @@ Class | Method | HTTP request | Description - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Return](docs/Return.md) - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index c5c2dfaffa71..1ac89ea205d3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -973,6 +973,46 @@ paths: summary: To test special tags tags: - $another-fake? + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + required: + - file + required: true + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet components: schemas: Category: @@ -1276,14 +1316,18 @@ components: type: array type: object OuterComposite: - example: {} + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: my_number: - $ref: '#/components/schemas/OuterNumber' + type: number my_string: - $ref: '#/components/schemas/OuterString' + type: string my_boolean: - $ref: '#/components/schemas/OuterBoolean' + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object format_test: properties: @@ -1381,6 +1425,10 @@ components: required: - className type: object + StringBooleanMap: + additionalProperties: + type: boolean + type: object Cat: allOf: - $ref: '#/components/schemas/Animal' @@ -1403,6 +1451,12 @@ components: - lower type: string type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' type: object Tag: example: diff --git a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go index 12c169016a2a..b9676e5e8bc5 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go @@ -24,7 +24,7 @@ var ( type AnotherFakeApiService service -/* +/* AnotherFakeApiService To test special tags To test special tags * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -85,7 +85,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Clie if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index 271a39f3613d..4fdbe1693e4c 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -26,7 +26,7 @@ var ( type FakeApiService service -/* +/* FakeApiService Test serialization of outer boolean types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -96,7 +96,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -122,7 +122,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of object with outer number type * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -196,7 +196,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -222,7 +222,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of outer number types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -292,7 +292,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -318,7 +318,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of outer string types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -388,7 +388,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -414,7 +414,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param query @@ -482,8 +482,8 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri return localVarHttpResponse, nil } -/* -FakeApiService To test \"client\" model +/* +FakeApiService To test \"client\" model To test \"client\" model * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param client client model @@ -543,7 +543,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -569,7 +569,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -719,7 +719,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa return localVarHttpResponse, nil } -/* +/* FakeApiService To test enum parameters To test enum parameters * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -828,7 +828,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona return localVarHttpResponse, nil } -/* +/* FakeApiService test inline additionalProperties * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param requestBody request body @@ -894,7 +894,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, req return localVarHttpResponse, nil } -/* +/* FakeApiService test json serialization of form data * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param field1 diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go index 13bc70f06251..78a0effb2b08 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go @@ -24,7 +24,7 @@ var ( type FakeClassnameTags123ApiService service -/* +/* FakeClassnameTags123ApiService To test class name in snake case To test class name in snake case * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -75,7 +75,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie } else { key = auth.Key } - localVarQueryParams.Add("api_key_query", key) } } @@ -99,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_pet.go b/samples/client/petstore/go/go-petstore-withXml/api_pet.go index 37db3a5b3535..9c933feeb547 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_pet.go @@ -27,7 +27,7 @@ var ( type PetApiService service -/* +/* PetApiService Add a new pet to the store * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param pet Pet object that needs to be added to the store @@ -93,7 +93,7 @@ func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, er return localVarHttpResponse, nil } -/* +/* PetApiService Deletes a pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete @@ -168,7 +168,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti return localVarHttpResponse, nil } -/* +/* PetApiService Finds Pets by status Multiple status values can be provided with comma separated strings * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -228,7 +228,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -254,7 +254,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -314,7 +314,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -340,7 +340,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Find pet by ID Returns a single pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -391,7 +391,6 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http key = auth.Key } localVarHeaderParams["api_key"] = key - } } @@ -414,7 +413,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -440,7 +439,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Update an existing pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param pet Pet object that needs to be added to the store @@ -506,7 +505,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, return localVarHttpResponse, nil } -/* +/* PetApiService Updates a pet in the store with form data * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated @@ -586,7 +585,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca return localVarHttpResponse, nil } -/* +/* PetApiService uploads an image * @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 @@ -671,7 +670,110 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ApiResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +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 optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: + * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server +@return ApiResponse +*/ + +type UploadFileWithRequiredFileOpts struct { + AdditionalMetadata optional.String +} + +func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, file *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { + localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) + } + localVarFile := file + 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) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_store.go b/samples/client/petstore/go/go-petstore-withXml/api_store.go index fd25fa94803b..e628e134281d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_store.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_store.go @@ -25,7 +25,7 @@ var ( type StoreApiService service -/* +/* StoreApiService Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -91,7 +91,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt return localVarHttpResponse, nil } -/* +/* StoreApiService Returns pet inventories by status Returns a map of status codes to quantities * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -140,7 +140,6 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * key = auth.Key } localVarHeaderParams["api_key"] = key - } } @@ -163,7 +162,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -189,7 +188,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * return localVarReturnValue, localVarHttpResponse, nil } -/* +/* StoreApiService Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -255,7 +254,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -281,7 +280,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde return localVarReturnValue, localVarHttpResponse, nil } -/* +/* StoreApiService Place an order for a pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param order order placed for purchasing the pet @@ -341,7 +340,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, * if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_user.go b/samples/client/petstore/go/go-petstore-withXml/api_user.go index 95350c677b1f..c24eeacc7029 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_user.go @@ -25,7 +25,7 @@ var ( type UserApiService service -/* +/* UserApiService Create user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -92,7 +92,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Respo return localVarHttpResponse, nil } -/* +/* UserApiService Creates list of users with given input array * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param user List of user object @@ -158,7 +158,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []U return localVarHttpResponse, nil } -/* +/* UserApiService Creates list of users with given input array * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param user List of user object @@ -224,7 +224,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []Us return localVarHttpResponse, nil } -/* +/* UserApiService Delete user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -290,7 +290,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http return localVarHttpResponse, nil } -/* +/* UserApiService Get user by user name * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be fetched. Use user1 for testing. @@ -349,7 +349,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -375,7 +375,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us return localVarReturnValue, localVarHttpResponse, nil } -/* +/* UserApiService Logs user into the system * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The user name for login @@ -436,7 +436,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -462,7 +462,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor return localVarReturnValue, localVarHttpResponse, nil } -/* +/* UserApiService Logs out current logged in user session * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ @@ -525,7 +525,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) return localVarHttpResponse, nil } -/* +/* UserApiService Updated user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/MapTest.md b/samples/client/petstore/go/go-petstore-withXml/docs/MapTest.md index 3f546994fd45..fc266d17df9d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/MapTest.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/MapTest.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional] **MapOfEnumString** | **map[string]string** | | [optional] +**DirectMap** | **map[string]bool** | | [optional] +**IndirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md index 9a78c747da00..327cc1739cd0 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**UpdatePet**](PetApi.md#UpdatePet) | **Put** /pet | Update an existing pet [**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data [**UploadFile**](PetApi.md#UploadFile) | **Post** /pet/{petId}/uploadImage | uploads an image +[**UploadFileWithRequiredFile**](PetApi.md#UploadFileWithRequiredFile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **AddPet** @@ -257,3 +258,40 @@ 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) +uploads an image (required) + +### Required Parameters + +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 | + **optional** | ***UploadFileWithRequiredFileOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UploadFileWithRequiredFileOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **additionalMetadata** | **optional.String**| Additional data to pass to server | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[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) + diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/StringBooleanMap.md b/samples/client/petstore/go/go-petstore-withXml/docs/StringBooleanMap.md new file mode 100644 index 000000000000..7abf11ec68b1 --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/go/go-petstore-withXml/model_map_test.go b/samples/client/petstore/go/go-petstore-withXml/model_map_test.go index 8e7db9872093..d8b5f96c423f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_map_test.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_map_test.go @@ -12,4 +12,6 @@ package petstore type MapTest struct { MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty" xml:"map_map_of_string"` MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty" xml:"map_of_enum_string"` + DirectMap map[string]bool `json:"direct_map,omitempty" xml:"direct_map"` + IndirectMap StringBooleanMap `json:"indirect_map,omitempty" xml:"indirect_map"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_string_boolean_map.go b/samples/client/petstore/go/go-petstore-withXml/model_string_boolean_map.go new file mode 100644 index 000000000000..7cc08c7e8958 --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/model_string_boolean_map.go @@ -0,0 +1,13 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore + +type StringBooleanMap struct { +} diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 282895a8f8f1..0628777500bd 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.3 \ No newline at end of file +3.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 2f44cf6ab749..55cb462ef068 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -50,7 +50,7 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **Post** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status *StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 2e5dbfa3f311..1ac89ea205d3 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -282,46 +282,6 @@ paths: summary: uploads an image tags: - pet - /pet/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - required: - - file - required: true - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet /store/inventory: get: description: Returns a map of status codes to quantities @@ -1013,6 +973,46 @@ paths: summary: To test special tags tags: - $another-fake? + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + required: + - file + required: true + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet components: schemas: Category: 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 12c169016a2a..b9676e5e8bc5 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -24,7 +24,7 @@ var ( type AnotherFakeApiService service -/* +/* AnotherFakeApiService To test special tags To test special tags * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -85,7 +85,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Clie if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 271a39f3613d..4fdbe1693e4c 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -26,7 +26,7 @@ var ( type FakeApiService service -/* +/* FakeApiService Test serialization of outer boolean types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -96,7 +96,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -122,7 +122,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of object with outer number type * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -196,7 +196,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -222,7 +222,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of outer number types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -292,7 +292,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -318,7 +318,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of outer string types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -388,7 +388,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -414,7 +414,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param query @@ -482,8 +482,8 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri return localVarHttpResponse, nil } -/* -FakeApiService To test \"client\" model +/* +FakeApiService To test \"client\" model To test \"client\" model * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param client client model @@ -543,7 +543,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -569,7 +569,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -719,7 +719,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa return localVarHttpResponse, nil } -/* +/* FakeApiService To test enum parameters To test enum parameters * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -828,7 +828,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona return localVarHttpResponse, nil } -/* +/* FakeApiService test inline additionalProperties * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param requestBody request body @@ -894,7 +894,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, req return localVarHttpResponse, nil } -/* +/* FakeApiService test json serialization of form data * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param field1 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 13bc70f06251..78a0effb2b08 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 @@ -24,7 +24,7 @@ var ( type FakeClassnameTags123ApiService service -/* +/* FakeClassnameTags123ApiService To test class name in snake case To test class name in snake case * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -75,7 +75,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie } else { key = auth.Key } - localVarQueryParams.Add("api_key_query", key) } } @@ -99,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index f44bbc804da4..9c933feeb547 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -27,7 +27,7 @@ var ( type PetApiService service -/* +/* PetApiService Add a new pet to the store * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param pet Pet object that needs to be added to the store @@ -93,7 +93,7 @@ func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, er return localVarHttpResponse, nil } -/* +/* PetApiService Deletes a pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete @@ -168,7 +168,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti return localVarHttpResponse, nil } -/* +/* PetApiService Finds Pets by status Multiple status values can be provided with comma separated strings * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -228,7 +228,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -254,7 +254,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -314,7 +314,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -340,7 +340,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Find pet by ID Returns a single pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -391,7 +391,6 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http key = auth.Key } localVarHeaderParams["api_key"] = key - } } @@ -414,7 +413,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -440,7 +439,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Update an existing pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param pet Pet object that needs to be added to the store @@ -506,7 +505,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, return localVarHttpResponse, nil } -/* +/* PetApiService Updates a pet in the store with form data * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated @@ -586,7 +585,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca return localVarHttpResponse, nil } -/* +/* PetApiService uploads an image * @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 @@ -671,7 +670,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -697,8 +696,8 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt return localVarReturnValue, localVarHttpResponse, nil } -/* -PetApiService uploads an image +/* +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 @@ -721,7 +720,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in ) // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImageWithRequiredFile" + localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) localVarHeaderParams := make(map[string]string) @@ -774,7 +773,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index fd25fa94803b..e628e134281d 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -25,7 +25,7 @@ var ( type StoreApiService service -/* +/* StoreApiService Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -91,7 +91,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt return localVarHttpResponse, nil } -/* +/* StoreApiService Returns pet inventories by status Returns a map of status codes to quantities * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -140,7 +140,6 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * key = auth.Key } localVarHeaderParams["api_key"] = key - } } @@ -163,7 +162,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -189,7 +188,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * return localVarReturnValue, localVarHttpResponse, nil } -/* +/* StoreApiService Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -255,7 +254,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -281,7 +280,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde return localVarReturnValue, localVarHttpResponse, nil } -/* +/* StoreApiService Place an order for a pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param order order placed for purchasing the pet @@ -341,7 +340,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, * if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 95350c677b1f..c24eeacc7029 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -25,7 +25,7 @@ var ( type UserApiService service -/* +/* UserApiService Create user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -92,7 +92,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Respo return localVarHttpResponse, nil } -/* +/* UserApiService Creates list of users with given input array * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param user List of user object @@ -158,7 +158,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []U return localVarHttpResponse, nil } -/* +/* UserApiService Creates list of users with given input array * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param user List of user object @@ -224,7 +224,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []Us return localVarHttpResponse, nil } -/* +/* UserApiService Delete user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -290,7 +290,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http return localVarHttpResponse, nil } -/* +/* UserApiService Get user by user name * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be fetched. Use user1 for testing. @@ -349,7 +349,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -375,7 +375,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us return localVarReturnValue, localVarHttpResponse, nil } -/* +/* UserApiService Logs user into the system * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The user name for login @@ -436,7 +436,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { + if err == nil { return localVarReturnValue, localVarHttpResponse, err } } @@ -462,7 +462,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor return localVarReturnValue, localVarHttpResponse, nil } -/* +/* UserApiService Logs out current logged in user session * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ @@ -525,7 +525,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) return localVarHttpResponse, nil } -/* +/* UserApiService Updated user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). diff --git a/samples/client/petstore/go/go-petstore/docs/MapTest.md b/samples/client/petstore/go/go-petstore/docs/MapTest.md index 4f2b9a39b094..fc266d17df9d 100644 --- a/samples/client/petstore/go/go-petstore/docs/MapTest.md +++ b/samples/client/petstore/go/go-petstore/docs/MapTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional] **MapOfEnumString** | **map[string]string** | | [optional] **DirectMap** | **map[string]bool** | | [optional] -**IndirectMap** | [***StringBooleanMap**](StringBooleanMap.md) | | [optional] +**IndirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/PetApi.md b/samples/client/petstore/go/go-petstore/docs/PetApi.md index 402f31e72910..327cc1739cd0 100644 --- a/samples/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**UpdatePet**](PetApi.md#UpdatePet) | **Put** /pet | Update an existing pet [**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data [**UploadFile**](PetApi.md#UploadFile) | **Post** /pet/{petId}/uploadImage | uploads an image -[**UploadFileWithRequiredFile**](PetApi.md#UploadFileWithRequiredFile) | **Post** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**UploadFileWithRequiredFile**](PetApi.md#UploadFileWithRequiredFile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **AddPet** @@ -260,7 +260,7 @@ Name | Type | Description | Notes # **UploadFileWithRequiredFile** > ApiResponse UploadFileWithRequiredFile(ctx, petId, file, optional) -uploads an image +uploads an image (required) ### Required Parameters diff --git a/samples/client/petstore/go/go-petstore/model_map_test.go b/samples/client/petstore/go/go-petstore/model_map_test.go index c5cd01d5a1d6..d0c3a6a19ff3 100644 --- a/samples/client/petstore/go/go-petstore/model_map_test.go +++ b/samples/client/petstore/go/go-petstore/model_map_test.go @@ -13,5 +13,5 @@ type MapTest struct { MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` DirectMap map[string]bool `json:"direct_map,omitempty"` - IndirectMap *StringBooleanMap `json:"indirect_map,omitempty"` + IndirectMap StringBooleanMap `json:"indirect_map,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 da3cb0cd4ae5..c96556b8bd84 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 @@ -184,14 +184,14 @@ public FindPetsByTagsQueryParams tags(final List value) { ModelApiResponse uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file); /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) * @param additionalMetadata Additional data to pass to server (optional, default to null) * @return ModelApiResponse */ - @RequestLine("POST /pet/{petId}/uploadImageWithRequiredFile") + @RequestLine("POST /fake/{petId}/uploadImageWithRequiredFile") @Headers({ "Content-Type: multipart/form-data", "Accept: application/json", 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 eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/google-api-client/docs/PetApi.md +++ b/samples/client/petstore/java/google-api-client/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 7ee23a1e3fee..4050796041b1 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 @@ -716,7 +716,7 @@ public HttpResponse uploadFileForHttpResponse(Long petId, Map pa /** - * uploads an image + * uploads an image (required) *

200 - successful operation * @param petId ID of pet to update * @param file file to upload @@ -731,7 +731,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String } /** - * uploads an image + * uploads an image (required) *

200 - successful operation * @param petId ID of pet to update * @param file file to upload @@ -756,7 +756,7 @@ public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File f // create a map of path variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}/uploadImageWithRequiredFile"); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/{petId}/uploadImageWithRequiredFile"); String url = uriBuilder.buildFromMap(uriVariables).toString(); GenericUrl genericUrl = new GenericUrl(url); @@ -776,7 +776,7 @@ public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File f // create a map of path variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}/uploadImageWithRequiredFile"); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/{petId}/uploadImageWithRequiredFile"); // Copy the params argument if present, to allow passing in immutable maps Map allParams = params == null ? new HashMap() : new HashMap(params); diff --git a/samples/client/petstore/java/jersey1/docs/PetApi.md b/samples/client/petstore/java/jersey1/docs/PetApi.md index eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/jersey1/docs/PetApi.md +++ b/samples/client/petstore/java/jersey1/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 7c9534e93375..520f7a984300 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 @@ -406,7 +406,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -428,7 +428,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile" + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md index eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 fa6ff5792ed6..7b381aa6005a 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 @@ -480,7 +480,7 @@ public ApiResponse uploadFileWithHttpInfo(Long petId, String a return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -493,7 +493,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -515,7 +515,7 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile" + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md index eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 fa6ff5792ed6..7b381aa6005a 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 @@ -480,7 +480,7 @@ public ApiResponse uploadFileWithHttpInfo(Long petId, String a return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -493,7 +493,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -515,7 +515,7 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile" + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey2/docs/PetApi.md b/samples/client/petstore/java/jersey2/docs/PetApi.md index eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/jersey2/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 fa6ff5792ed6..7b381aa6005a 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 @@ -480,7 +480,7 @@ public ApiResponse uploadFileWithHttpInfo(Long petId, String a return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -493,7 +493,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -515,7 +515,7 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile" + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params 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 eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 b0ab91c18ef9..76831933748a 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 @@ -1077,7 +1077,7 @@ public com.squareup.okhttp.Call uploadFileWithRequiredFileCall(Long petId, File Object localVarPostBody = new Object(); // create path and map variables - String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile" + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -1139,7 +1139,7 @@ private com.squareup.okhttp.Call uploadFileWithRequiredFileValidateBeforeCall(Lo } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -1153,7 +1153,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -1168,7 +1168,7 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long } /** - * uploads an image (asynchronously) + * uploads an image (required) (asynchronously) * * @param petId ID of pet to update (required) * @param file file to upload (required) diff --git a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 b0ab91c18ef9..76831933748a 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 @@ -1077,7 +1077,7 @@ public com.squareup.okhttp.Call uploadFileWithRequiredFileCall(Long petId, File Object localVarPostBody = new Object(); // create path and map variables - String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile" + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -1139,7 +1139,7 @@ private com.squareup.okhttp.Call uploadFileWithRequiredFileValidateBeforeCall(Lo } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -1153,7 +1153,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -1168,7 +1168,7 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long } /** - * uploads an image (asynchronously) + * uploads an image (required) (asynchronously) * * @param petId ID of pet to update (required) * @param file file to upload (required) diff --git a/samples/client/petstore/java/rest-assured/docs/PetApi.md b/samples/client/petstore/java/rest-assured/docs/PetApi.md index fb3a0d8e1eea..c61ebe262ef6 100644 --- a/samples/client/petstore/java/rest-assured/docs/PetApi.md +++ b/samples/client/petstore/java/rest-assured/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -350,7 +350,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 bfc21ac2dc12..f8c8533b380e 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 @@ -743,7 +743,7 @@ public UploadFileOper respSpec(Consumer consumer) { } } /** - * uploads an image + * uploads an image (required) * * * @see #petIdPath ID of pet to update (required) @@ -753,7 +753,7 @@ public UploadFileOper respSpec(Consumer consumer) { */ public class UploadFileWithRequiredFileOper { - public static final String REQ_URI = "/pet/{petId}/uploadImageWithRequiredFile"; + public static final String REQ_URI = "/fake/{petId}/uploadImageWithRequiredFile"; private RequestSpecBuilder reqSpec; @@ -774,7 +774,7 @@ public UploadFileWithRequiredFileOper(RequestSpecBuilder reqSpec) { } /** - * POST /pet/{petId}/uploadImageWithRequiredFile + * POST /fake/{petId}/uploadImageWithRequiredFile * @param handler handler * @param type * @return type @@ -784,7 +784,7 @@ public T execute(Function handler) { } /** - * POST /pet/{petId}/uploadImageWithRequiredFile + * POST /fake/{petId}/uploadImageWithRequiredFile * @param handler handler * @return ModelApiResponse */ diff --git a/samples/client/petstore/java/resteasy/docs/PetApi.md b/samples/client/petstore/java/resteasy/docs/PetApi.md index eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/resteasy/docs/PetApi.md +++ b/samples/client/petstore/java/resteasy/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 c186143a9791..2cffbb8a9ba4 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 @@ -384,7 +384,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -406,7 +406,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile".replaceAll("\\{format\\}","json") + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("\\{format\\}","json") .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md index eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 4e07b0c0c439..3161a9ee5e5d 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 @@ -356,7 +356,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** - * uploads an image + * uploads an image (required) * *

200 - successful operation * @param petId ID of pet to update @@ -381,7 +381,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString(); + String path = UriComponentsBuilder.fromPath("/fake/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate/docs/PetApi.md b/samples/client/petstore/java/resttemplate/docs/PetApi.md index eb47b476a1a8..dd4224a90200 100644 --- a/samples/client/petstore/java/resttemplate/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 4e07b0c0c439..3161a9ee5e5d 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 @@ -356,7 +356,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** - * uploads an image + * uploads an image (required) * *

200 - successful operation * @param petId ID of pet to update @@ -381,7 +381,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString(); + String path = UriComponentsBuilder.fromPath("/fake/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); 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 e20531160bb7..e7ccda2dc65a 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 @@ -223,7 +223,7 @@ void uploadFile( @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("additionalMetadata") String additionalMetadata, @retrofit.http.Part("file") TypedFile file, Callback cb ); /** - * uploads an image + * uploads an image (required) * Sync method * * @param petId ID of pet to update (required) @@ -233,13 +233,13 @@ void uploadFile( */ @retrofit.http.Multipart - @POST("/pet/{petId}/uploadImageWithRequiredFile") + @POST("/fake/{petId}/uploadImageWithRequiredFile") ModelApiResponse uploadFileWithRequiredFile( @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("file") TypedFile file, @retrofit.http.Part("additionalMetadata") String additionalMetadata ); /** - * uploads an image + * uploads an image (required) * Async method * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -248,7 +248,7 @@ ModelApiResponse uploadFileWithRequiredFile( */ @retrofit.http.Multipart - @POST("/pet/{petId}/uploadImageWithRequiredFile") + @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 ); diff --git a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md index cde9eda467e3..88e229bd8ee5 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 adb8fce7d5de..dc1c0df8ce1e 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 @@ -126,7 +126,7 @@ F.Promise> uploadFile( ); /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -134,7 +134,7 @@ F.Promise> uploadFile( * @return Call<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("pet/{petId}/uploadImageWithRequiredFile") + @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 ); diff --git a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md index cde9eda467e3..88e229bd8ee5 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 bb09b995d1d1..d3e7d96bfba4 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 @@ -126,7 +126,7 @@ CompletionStage> uploadFile( ); /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -134,7 +134,7 @@ CompletionStage> uploadFile( * @return Call<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("pet/{petId}/uploadImageWithRequiredFile") + @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 ); diff --git a/samples/client/petstore/java/retrofit2/docs/PetApi.md b/samples/client/petstore/java/retrofit2/docs/PetApi.md index cde9eda467e3..88e229bd8ee5 100644 --- a/samples/client/petstore/java/retrofit2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 0261620786e3..bd41997b4e0b 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 @@ -123,7 +123,7 @@ Call uploadFile( ); /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -131,7 +131,7 @@ Call uploadFile( * @return Call<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("pet/{petId}/uploadImageWithRequiredFile") + @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 ); diff --git a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md index cde9eda467e3..88e229bd8ee5 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 7929df96d2a5..e60b78d8aedf 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 @@ -123,7 +123,7 @@ Observable uploadFile( ); /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -131,7 +131,7 @@ Observable uploadFile( * @return Observable<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("pet/{petId}/uploadImageWithRequiredFile") + @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 ); diff --git a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md index cde9eda467e3..88e229bd8ee5 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 a08da60b41a9..cc94ec835897 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 @@ -124,7 +124,7 @@ Observable uploadFile( ); /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -132,7 +132,7 @@ Observable uploadFile( * @return Observable<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("pet/{petId}/uploadImageWithRequiredFile") + @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 ); diff --git a/samples/client/petstore/java/vertx/docs/PetApi.md b/samples/client/petstore/java/vertx/docs/PetApi.md index c22e8f2438b4..0cd9ccd83385 100644 --- a/samples/client/petstore/java/vertx/docs/PetApi.md +++ b/samples/client/petstore/java/vertx/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -441,7 +441,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata) -uploads an image +uploads an image (required) ### Example ```java 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 a33fcb54af63..58ba182d7d9d 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 @@ -325,7 +325,7 @@ public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Ha apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -348,7 +348,7 @@ public void uploadFileWithRequiredFile(Long petId, AsyncFile file, String additi } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile".replaceAll("\\{" + "petId" + "\\}", petId.toString()); + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("\\{" + "petId" + "\\}", petId.toString()); // query params List localVarQueryParams = new ArrayList<>(); 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 ee1053e27946..7edbd19f5039 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 @@ -202,7 +202,7 @@ public Single rxUploadFile(Long petId, String additionalMetada })); } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) @@ -214,7 +214,7 @@ public void uploadFileWithRequiredFile(Long petId, AsyncFile file, String additi } /** - * uploads an image + * uploads an image (required) * * @param petId ID of pet to update (required) * @param file file to upload (required) diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 41d7335deb1f..615b5cc3fc7b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -99,7 +99,7 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**uploadFileWithRequiredFile**](docs/Api/PetApi.md#uploadfilewithrequiredfile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/Api/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID 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 48a397fd6268..647d70aae926 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **addPet** @@ -440,7 +440,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > \OpenAPI\Client\Model\ApiResponse uploadFileWithRequiredFile($pet_id, $file, $additional_metadata) -uploads an image +uploads an image (required) ### Example ```php 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 a2b2b7aed021..7a020d038813 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -2177,7 +2177,7 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file /** * Operation uploadFileWithRequiredFile * - * uploads an image + * uploads an image (required) * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $file file to upload (required) @@ -2196,7 +2196,7 @@ public function uploadFileWithRequiredFile($pet_id, $file, $additional_metadata /** * Operation uploadFileWithRequiredFileWithHttpInfo * - * uploads an image + * uploads an image (required) * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $file file to upload (required) @@ -2292,7 +2292,7 @@ public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $file, $addition /** * Operation uploadFileWithRequiredFileAsync * - * uploads an image + * uploads an image (required) * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $file file to upload (required) @@ -2314,7 +2314,7 @@ function ($response) { /** * Operation uploadFileWithRequiredFileAsyncWithHttpInfo * - * uploads an image + * uploads an image (required) * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $file file to upload (required) @@ -2390,7 +2390,7 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $file, $additional ); } - $resourcePath = '/pet/{petId}/uploadImageWithRequiredFile'; + $resourcePath = '/fake/{petId}/uploadImageWithRequiredFile'; $formParams = []; $queryParams = []; $headerParams = []; diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index c24b9f47f573..5f1306b5e548 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -154,7 +154,7 @@ public function testUploadFile() /** * Test case for uploadFileWithRequiredFile * - * uploads an image. + * uploads an image (required). * */ public function testUploadFileWithRequiredFile() diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 98f08b8e3423..f999a2744cb9 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -93,7 +93,7 @@ Class | Method | HTTP request | Description *Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet *Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data *Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status *Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index aecfde29f2c3..60a4bc68d10b 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet [**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data [**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **add_pet** @@ -422,7 +422,7 @@ Name | Type | Description | Notes # **upload_file_with_required_file** > ApiResponse upload_file_with_required_file(pet_id, file, opts) -uploads an image +uploads an image (required) ### Example ```ruby @@ -442,7 +442,7 @@ opts = { } begin - #uploads an image + #uploads an image (required) result = api_instance.upload_file_with_required_file(pet_id, file, opts) p result rescue Petstore::ApiError => e 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 21d536302d15..2554cbe6952f 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -438,7 +438,7 @@ def upload_file_with_http_info(pet_id, opts = {}) end return data, status_code, headers end - # uploads an image + # uploads an image (required) # @param pet_id ID of pet to update # @param file file to upload # @param [Hash] opts the optional parameters @@ -449,7 +449,7 @@ def upload_file_with_required_file(pet_id, file, opts = {}) data end - # uploads an image + # uploads an image (required) # @param pet_id ID of pet to update # @param file file to upload # @param [Hash] opts the optional parameters @@ -468,7 +468,7 @@ def upload_file_with_required_file_with_http_info(pet_id, file, opts = {}) fail ArgumentError, "Missing the required parameter 'file' when calling PetApi.upload_file_with_required_file" end # resource path - local_var_path = '/pet/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md index e4d699fe972a..5c1b9df2886f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md @@ -99,7 +99,7 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**uploadFileWithRequiredFile**](docs/Api/PetApi.md#uploadfilewithrequiredfile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/Api/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID 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 48a397fd6268..647d70aae926 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 @@ -12,7 +12,7 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /pet/{petId}/uploadImageWithRequiredFile | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **addPet** @@ -440,7 +440,7 @@ Name | Type | Description | Notes # **uploadFileWithRequiredFile** > \OpenAPI\Client\Model\ApiResponse uploadFileWithRequiredFile($pet_id, $file, $additional_metadata) -uploads an image +uploads an image (required) ### Example ```php 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 07652826b2f3..7a020d038813 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 @@ -756,7 +756,7 @@ protected function findPetsByStatusRequest($status) // query params if (is_array($status)) { - $status = ObjectSerializer::serializeCollection($status, 'multi', true); + $status = ObjectSerializer::serializeCollection($status, 'csv', true); } if ($status !== null) { $queryParams['status'] = ObjectSerializer::toQueryValue($status); @@ -1040,7 +1040,7 @@ protected function findPetsByTagsRequest($tags) // query params if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, 'multi', true); + $tags = ObjectSerializer::serializeCollection($tags, 'csv', true); } if ($tags !== null) { $queryParams['tags'] = ObjectSerializer::toQueryValue($tags); @@ -2177,7 +2177,7 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file /** * Operation uploadFileWithRequiredFile * - * uploads an image + * uploads an image (required) * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $file file to upload (required) @@ -2196,7 +2196,7 @@ public function uploadFileWithRequiredFile($pet_id, $file, $additional_metadata /** * Operation uploadFileWithRequiredFileWithHttpInfo * - * uploads an image + * uploads an image (required) * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $file file to upload (required) @@ -2292,7 +2292,7 @@ public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $file, $addition /** * Operation uploadFileWithRequiredFileAsync * - * uploads an image + * uploads an image (required) * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $file file to upload (required) @@ -2314,7 +2314,7 @@ function ($response) { /** * Operation uploadFileWithRequiredFileAsyncWithHttpInfo * - * uploads an image + * uploads an image (required) * * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $file file to upload (required) @@ -2390,7 +2390,7 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $file, $additional ); } - $resourcePath = '/pet/{petId}/uploadImageWithRequiredFile'; + $resourcePath = '/fake/{petId}/uploadImageWithRequiredFile'; $formParams = []; $queryParams = []; $headerParams = []; diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index c24b9f47f573..5f1306b5e548 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -154,7 +154,7 @@ public function testUploadFile() /** * Test case for uploadFileWithRequiredFile * - * uploads an image. + * uploads an image (required). * */ public function testUploadFileWithRequiredFile() 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 f134cb8ce5eb..7010ca7717e2 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 @@ -140,14 +140,14 @@ public interface PetApi { public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); /** - * uploads an image + * uploads an image (required) * */ @POST - @Path("/pet/{petId}/uploadImageWithRequiredFile") + @Path("/fake/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", tags={ "pet" }) + @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); 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 be862bb6fe4c..5f4d22228775 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 @@ -12,6 +12,7 @@ import java.io.File; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -211,4 +212,25 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true, defa throws NotFoundException { return delegate.testJsonFormData(param,param2,securityContext); } + @POST + @Path("/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @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 +,@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); + } } 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 239e14f2a2d5..b60fe75874fe 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 @@ -10,6 +10,7 @@ import java.io.File; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -34,4 +35,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; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java index fd404b7bb7a7..c915d919bab9 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java @@ -208,25 +208,4 @@ public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true throws NotFoundException { return delegate.uploadFile(petId,additionalMetadata,fileInputStream, fileDetail,securityContext); } - @POST - @Path("/{petId}/uploadImageWithRequiredFile") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @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 -,@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); - } } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java index 47299bb5daf9..ebd89ee5c3a0 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java @@ -27,5 +27,4 @@ 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; } 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 898f2b44fa7c..3447b13b3942 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 @@ -8,6 +8,7 @@ import java.io.File; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -74,4 +75,9 @@ public Response testJsonFormData(String param, String param2, SecurityContext se // do some magic! 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 { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index b282f8833f9b..366b2e4e1337 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -59,9 +59,4 @@ public Response uploadFile(Long petId, String additionalMetadata, InputStream fi // do some magic! 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 { - // 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 0b4e2ee73a20..1b358b2c1aff 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 @@ -6,6 +6,7 @@ import java.io.File; import org.joda.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -101,8 +102,23 @@ void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@For @GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", notes = "", tags={ "fake" }) + @ApiOperation(value = "test json serialization of form data", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); + + @POST + @Path("/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image (required)", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, 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); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java index 1507e6e229b0..ea35664ca3c2 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java @@ -118,24 +118,9 @@ public interface PetApi { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) - }, tags={ "pet", }) + }, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, @FormParam(value = "file") Attachment fileDetail); - - @POST - @Path("/{petId}/uploadImageWithRequiredFile") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, 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); } 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 fa165f2bff1b..26e70a7de9be 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 @@ -298,48 +298,6 @@ paths: - pet x-tags: - tag: pet - /pet/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - required: - - file - required: true - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-tags: - - tag: pet /store/inventory: get: description: Returns a map of status codes to quantities @@ -1079,6 +1037,48 @@ paths: - $another-fake? x-tags: - tag: $another-fake? + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + required: + - file + required: true + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-tags: + - tag: pet components: schemas: Category: 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 06fa48bc4e10..7e604381114c 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 @@ -6,6 +6,7 @@ import java.io.File; import org.joda.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -128,11 +129,29 @@ public Response testInlineAdditionalProperties(@Valid Map reques @GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) + @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { return Response.ok().entity("magic!").build(); } + + @POST + @Path("/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet" }) + @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) { + return Response.ok().entity("magic!").build(); + } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java index 7f06dbe8d0c6..ec2658d28ced 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java @@ -139,7 +139,7 @@ public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) - }, tags={ "pet", }) + }, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @@ -147,22 +147,4 @@ public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") @FormParam(value = "file") Attachment fileDetail) { return Response.ok().entity("magic!").build(); } - - @POST - @Path("/{petId}/uploadImageWithRequiredFile") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) - @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) { - 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 fa165f2bff1b..26e70a7de9be 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -298,48 +298,6 @@ paths: - pet x-tags: - tag: pet - /pet/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - required: - - file - required: true - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-tags: - - tag: pet /store/inventory: get: description: Returns a map of status codes to quantities @@ -1079,6 +1037,48 @@ paths: - $another-fake? x-tags: - tag: $another-fake? + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + required: + - file + required: true + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-tags: + - tag: pet components: schemas: Category: 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 9ad52e5c7746..9251d6cb63d0 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 @@ -190,10 +190,10 @@ public Response uploadFile( return delegate.uploadFile(petId,additionalMetadata,inputStream, fileDetail,securityContext); } @POST - + @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") 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 484cbe442541..f74064e0f504 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 @@ -15,6 +15,7 @@ import java.util.Date; import java.io.File; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -187,7 +188,7 @@ public Response testInlineAdditionalProperties( @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) + @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData( @@ -197,4 +198,25 @@ public Response testJsonFormData( throws NotFoundException { return delegate.testJsonFormData(param,param2,securityContext); } + @POST + @Path("/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet" }) + @io.swagger.annotations.ApiResponses(value = { + @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("additionalMetadata") String additionalMetadata, + @Context SecurityContext securityContext) + throws NotFoundException { + return delegate.uploadFileWithRequiredFile(petId,inputStream, fileDetail,additionalMetadata,securityContext); + } } 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 e105762e300f..eca1ec19b4f3 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 @@ -10,6 +10,7 @@ import java.util.Date; import java.io.File; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -46,4 +47,6 @@ public abstract Response testInlineAdditionalProperties(Map requ 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; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java index 8b130f30f0e5..4d6288f5ef5b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java @@ -177,7 +177,7 @@ public Response updatePetWithForm( @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) - }, tags={ "pet", }) + }, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFile( @@ -189,25 +189,4 @@ public Response uploadFile( throws NotFoundException { return delegate.uploadFile(petId,additionalMetadata,inputStream, fileDetail,securityContext); } - @POST - @Path("/{petId}/uploadImageWithRequiredFile") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) - @io.swagger.annotations.ApiResponses(value = { - @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("additionalMetadata") String additionalMetadata, - @Context SecurityContext securityContext) - throws NotFoundException { - return delegate.uploadFileWithRequiredFile(petId,inputStream, fileDetail,additionalMetadata,securityContext); - } } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApiService.java index ce8c271d31a8..9af313fd74a1 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApiService.java @@ -38,6 +38,4 @@ public abstract Response updatePetWithForm(Long petId,String name,String status, 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; } 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 a775f2311c83..8af485de98a1 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 @@ -10,6 +10,7 @@ import java.util.Date; import java.io.File; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -86,4 +87,10 @@ public Response testJsonFormData(String param, String param2, SecurityContext se // do some magic! 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 { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } } diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index ade99c7c99ab..4531f4b4b697 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -70,10 +70,4 @@ public Response uploadFile(Long petId, String additionalMetadata, InputStream fi // do some magic! 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 { - // 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 3a8d6f1c2c17..810cd35f38f6 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 @@ -209,10 +209,10 @@ public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true return delegate.uploadFile(petId,additionalMetadata,fileInputStream, fileDetail,securityContext); } @POST - + @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") 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 6819d8cf46f0..8748224956c3 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 @@ -12,6 +12,7 @@ import java.util.Date; import java.io.File; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -210,4 +211,25 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true, defa throws NotFoundException { return delegate.testJsonFormData(param,param2,securityContext); } + @POST + @Path("/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @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 +,@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); + } } 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 76704bdef050..04037355ed63 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 @@ -10,6 +10,7 @@ import java.util.Date; import java.io.File; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -33,4 +34,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; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java index fd404b7bb7a7..c915d919bab9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java @@ -208,25 +208,4 @@ public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true throws NotFoundException { return delegate.uploadFile(petId,additionalMetadata,fileInputStream, fileDetail,securityContext); } - @POST - @Path("/{petId}/uploadImageWithRequiredFile") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @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 -,@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); - } } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java index 47299bb5daf9..ebd89ee5c3a0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java @@ -27,5 +27,4 @@ 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; } 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 b68bbb70b1bc..e48ca70b5c81 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 @@ -8,6 +8,7 @@ import java.util.Date; import java.io.File; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -73,4 +74,9 @@ public Response testJsonFormData(String param, String param2, SecurityContext se // do some magic! 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 { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } } diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index b282f8833f9b..366b2e4e1337 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -59,9 +59,4 @@ public Response uploadFile(Long petId, String additionalMetadata, InputStream fi // do some magic! 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 { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } } diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php index ad7097f7db43..1c519f4ea217 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php @@ -26,6 +26,26 @@ public function __construct() { } + /** + * Operation uploadFileWithRequiredFile + * + * uploads an image (required). + * + * @param int $pet_id ID of pet to update (required) + * + * @return Http response + */ + public function uploadFileWithRequiredFile($pet_id) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing uploadFileWithRequiredFile as a post method ?'); + } /** * Operation addPet * @@ -202,24 +222,4 @@ public function uploadFile($pet_id) return response('How about implementing uploadFile as a post method ?'); } - /** - * Operation uploadFileWithRequiredFile - * - * uploads an image. - * - * @param int $pet_id ID of pet to update (required) - * - * @return Http response - */ - public function uploadFileWithRequiredFile($pet_id) - { - $input = Request::all(); - - //path params validation - - - //not path params validation - - return response('How about implementing uploadFileWithRequiredFile as a post method ?'); - } } diff --git a/samples/server/petstore/php-lumen/lib/app/Http/routes.php b/samples/server/petstore/php-lumen/lib/app/Http/routes.php index e2dfa91a7e31..99202ede02e7 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/routes.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/routes.php @@ -105,6 +105,13 @@ * Output-Formats: [application/json] */ $app->patch('/v2/fake_classname_test', 'FakeClassnameTags123Api@testClassname'); +/** + * post uploadFileWithRequiredFile + * Summary: uploads an image (required) + * Notes: + * Output-Formats: [application/json] + */ +$app->post('/v2/fake/{petId}/uploadImageWithRequiredFile', 'PetApi@uploadFileWithRequiredFile'); /** * post addPet * Summary: Add a new pet to the store @@ -161,13 +168,6 @@ * Output-Formats: [application/json] */ $app->post('/v2/pet/{petId}/uploadImage', 'PetApi@uploadFile'); -/** - * post uploadFileWithRequiredFile - * Summary: uploads an image - * Notes: - * Output-Formats: [application/json] - */ -$app->post('/v2/pet/{petId}/uploadImageWithRequiredFile', 'PetApi@uploadFileWithRequiredFile'); /** * get getInventory * Summary: Returns pet inventories by status diff --git a/samples/server/petstore/php-slim/index.php b/samples/server/petstore/php-slim/index.php index 60eebdf19580..dc0849ad7959 100644 --- a/samples/server/petstore/php-slim/index.php +++ b/samples/server/petstore/php-slim/index.php @@ -295,11 +295,11 @@ /** * POST uploadFileWithRequiredFile - * Summary: uploads an image + * Summary: uploads an image (required) * Notes: * Output-Formats: [application/json] */ -$app->POST('/v2/pet/{petId}/uploadImageWithRequiredFile', function($request, $response, $args) { +$app->POST('/v2/fake/{petId}/uploadImageWithRequiredFile', function($request, $response, $args) { $petId = $args['petId']; $additionalMetadata = $request->getParsedBodyParam('additionalMetadata'); $file = (key_exists('file', $request->getUploadedFiles())) ? $request->getUploadedFiles()['file'] : null; diff --git a/samples/server/petstore/php-ze-ph/application/config/path_handler.yml b/samples/server/petstore/php-ze-ph/application/config/path_handler.yml index fc5c123eff14..2173e7fc29b4 100644 --- a/samples/server/petstore/php-ze-ph/application/config/path_handler.yml +++ b/samples/server/petstore/php-ze-ph/application/config/path_handler.yml @@ -33,13 +33,13 @@ Articus\PathHandler\Router\FastRouteAnnotation: - App\Handler\FakeOuterComposite - App\Handler\FakeOuterNumber - App\Handler\FakeOuterString + - App\Handler\FakePetIdUploadImageWithRequiredFile - App\Handler\FakeClassnameTest - App\Handler\Pet - App\Handler\PetFindByStatus - App\Handler\PetFindByTags - App\Handler\PetPetId - App\Handler\PetPetIdUploadImage - - App\Handler\PetPetIdUploadImageWithRequiredFile - App\Handler\StoreInventory - App\Handler\StoreOrder - App\Handler\StoreOrderOrderId @@ -60,13 +60,13 @@ Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory: App\Handler\FakeOuterComposite: [] App\Handler\FakeOuterNumber: [] App\Handler\FakeOuterString: [] + App\Handler\FakePetIdUploadImageWithRequiredFile: [] App\Handler\FakeClassnameTest: [] App\Handler\Pet: [] App\Handler\PetFindByStatus: [] App\Handler\PetFindByTags: [] App\Handler\PetPetId: [] App\Handler\PetPetIdUploadImage: [] - App\Handler\PetPetIdUploadImageWithRequiredFile: [] App\Handler\StoreInventory: [] App\Handler\StoreOrder: [] App\Handler\StoreOrderOrderId: [] diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakePetIdUploadImageWithRequiredFile.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakePetIdUploadImageWithRequiredFile.php new file mode 100644 index 000000000000..228936e146c5 --- /dev/null +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/FakePetIdUploadImageWithRequiredFile.php @@ -0,0 +1,33 @@ +> testJsonFormData(@ApiParam(value } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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) { + return CompletableFuture.supplyAsync(()-> { + getRequest().ifPresent(request -> { + 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\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + }, Runnable::run); + + } + } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index f818bfaecfb5..55fba76aca4a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -228,32 +228,4 @@ default CompletableFuture> uploadFile(@ApiParam } - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - 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\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - } 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 78c6d7f3e729..1b8fd08fed18 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 @@ -10,6 +10,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; import org.openapitools.model.User; @@ -206,4 +207,30 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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) { + getRequest().ifPresent(request -> { + 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\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 155da0b9f179..9559bbf098d5 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -219,30 +219,4 @@ default ResponseEntity uploadFile(@ApiParam(value = "ID of pet } - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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) { - getRequest().ifPresent(request -> { - 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\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } 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 21ba95b5edd6..41d13e06f643 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 @@ -9,6 +9,7 @@ import org.openapitools.model.Client; import org.threeten.bp.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -128,4 +129,19 @@ public interface FakeApi { method = RequestMethod.GET) ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true, defaultValue="null") @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true, defaultValue="null") @RequestParam(value="param2", required=true) String param2); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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); + } 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 fef8e0576992..1853d9cda982 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 @@ -4,6 +4,7 @@ import org.openapitools.model.Client; import org.threeten.bp.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -118,4 +119,15 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require } + 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) { + 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\"}"); + break; + } + } + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index b207d39f84cd..e9dc9c37ccef 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -143,19 +143,4 @@ public interface PetApi { method = RequestMethod.POST) ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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); - } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java index 722ed3221e84..20ea8d651a4f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java @@ -109,15 +109,4 @@ public ResponseEntity uploadFile(@ApiParam(value = "ID of pet } - 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) { - 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\"}"); - break; - } - } - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } 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 21ba95b5edd6..41d13e06f643 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 @@ -9,6 +9,7 @@ import org.openapitools.model.Client; import org.threeten.bp.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -128,4 +129,19 @@ public interface FakeApi { method = RequestMethod.GET) ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true, defaultValue="null") @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true, defaultValue="null") @RequestParam(value="param2", required=true) String param2); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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); + } 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 000b811e058e..aa8f2eaf2966 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 @@ -4,6 +4,7 @@ import org.openapitools.model.Client; import org.threeten.bp.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -118,4 +119,15 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require } + 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) { + 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\"}"); + break; + } + } + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index b207d39f84cd..e9dc9c37ccef 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -143,19 +143,4 @@ public interface PetApi { method = RequestMethod.POST) ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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); - } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java index 80fb91e825e9..b01cdf874b30 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java @@ -109,15 +109,4 @@ public ResponseEntity uploadFile(@ApiParam(value = "ID of pet } - 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) { - 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\"}"); - break; - } - } - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } 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 c2eed78d6a2b..3f13386bbeed 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 @@ -9,6 +9,7 @@ import org.openapitools.model.Client; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -152,4 +153,21 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir return getDelegate().testJsonFormData(param, param2); } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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); + } + } 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 aea629f7edaa..d3a53a337e76 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 @@ -4,6 +4,7 @@ import org.openapitools.model.Client; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -172,4 +173,22 @@ default ResponseEntity testJsonFormData( String param, } + /** + * @see FakeApi#uploadFileWithRequiredFile + */ + default ResponseEntity uploadFileWithRequiredFile( Long petId, + MultipartFile file, + String additionalMetadata) { + getRequest().ifPresent(request -> { + 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\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index a9cd158432a0..8cab0b706a9f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -163,21 +163,4 @@ default ResponseEntity uploadFile(@ApiParam(value = "ID of pet return getDelegate().uploadFile(petId, additionalMetadata, file); } - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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); - } - } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index a5b1f721cd10..88a778effd80 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -138,22 +138,4 @@ default ResponseEntity uploadFile( Long petId, } - /** - * @see PetApi#uploadFileWithRequiredFile - */ - default ResponseEntity uploadFileWithRequiredFile( Long petId, - MultipartFile file, - String additionalMetadata) { - getRequest().ifPresent(request -> { - 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\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } 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 21ba95b5edd6..41d13e06f643 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 @@ -9,6 +9,7 @@ import org.openapitools.model.Client; import org.threeten.bp.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -128,4 +129,19 @@ public interface FakeApi { method = RequestMethod.GET) ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true, defaultValue="null") @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true, defaultValue="null") @RequestParam(value="param2", required=true) String param2); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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); + } 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 d18e35cff3e8..28d0411df16e 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 @@ -4,6 +4,7 @@ import org.openapitools.model.Client; import org.threeten.bp.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -76,4 +77,8 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require 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); + } + } 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 0d8e15b5a5a1..1ac97735aa17 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 @@ -4,6 +4,7 @@ import org.openapitools.model.Client; import org.threeten.bp.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -94,4 +95,11 @@ ResponseEntity testEnumParameters( List enumHeaderStringArray, ResponseEntity testJsonFormData( String param, String param2); + /** + * @see FakeApi#uploadFileWithRequiredFile + */ + ResponseEntity uploadFileWithRequiredFile( Long petId, + MultipartFile file, + String additionalMetadata); + } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index b207d39f84cd..e9dc9c37ccef 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -143,19 +143,4 @@ public interface PetApi { method = RequestMethod.POST) ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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); - } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index b39c37857f0a..4e56a5931446 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -63,8 +63,4 @@ public ResponseEntity uploadFile(@ApiParam(value = "ID of pet return delegate.uploadFile(petId, additionalMetadata, file); } - 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); - } - } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index 0251e06b3c3a..13f6acf44c70 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -62,11 +62,4 @@ ResponseEntity uploadFile( Long petId, String additionalMetadata, MultipartFile file); - /** - * @see PetApi#uploadFileWithRequiredFile - */ - ResponseEntity uploadFileWithRequiredFile( Long petId, - MultipartFile file, - 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 555ae7e22b16..2217b0cf81ee 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 @@ -9,6 +9,7 @@ import org.openapitools.model.Client; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -228,4 +229,32 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @ApiImplicitParams({ + }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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) { + getRequest().ifPresent(request -> { + 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\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 11e98f37aead..e15f482431fb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -236,32 +236,4 @@ default ResponseEntity uploadFile(@ApiParam(value = "ID of pet } - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @ApiImplicitParams({ - }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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) { - getRequest().ifPresent(request -> { - 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\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } 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 65eeb503d6f6..f825e1b2caa4 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 @@ -9,6 +9,7 @@ import org.openapitools.model.Client; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -209,4 +210,30 @@ default ResponseEntity> testJsonFormData(@ApiParam(value = "field1", } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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) { + Mono result = Mono.empty(); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + result = ApiUtil.getExampleResponse(exchange, "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}") + .then(Mono.empty()); + break; + } + } + return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).body(result); + + } + } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index a483be41ccdf..e747a234faa5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -224,30 +224,4 @@ default ResponseEntity> uploadFile(@ApiParam(value = "ID } - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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) { - Mono result = Mono.empty(); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - result = ApiUtil.getExampleResponse(exchange, "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}") - .then(Mono.empty()); - break; - } - } - return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).body(result); - - } - } 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 b09398ca5e11..072978c8fa8a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -310,50 +310,6 @@ paths: x-accepts: application/json x-tags: - tag: pet - /pet/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - required: - - file - required: true - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet /store/inventory: get: description: Returns a map of status codes to quantities @@ -1134,6 +1090,50 @@ paths: x-accepts: application/json x-tags: - tag: $another-fake? + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + required: + - file + required: true + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet components: schemas: Category: 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 9c3a58b5fc66..a9b2a1cc8952 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 @@ -9,6 +9,7 @@ import org.openapitools.model.Client; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -206,4 +207,30 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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) { + getRequest().ifPresent(request -> { + 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\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 65ffc288c478..aeea6e160aaf 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -219,30 +219,4 @@ default ResponseEntity uploadFile(@ApiParam(value = "ID of pet } - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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) { - getRequest().ifPresent(request -> { - 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\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } 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 bf690fc6dc6c..92917838edd7 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 @@ -9,6 +9,7 @@ import org.openapitools.model.Client; import java.time.LocalDate; import java.util.Map; +import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; @@ -206,4 +207,30 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + 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) { + getRequest().ifPresent(request -> { + 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\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 155da0b9f179..9559bbf098d5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -219,30 +219,4 @@ default ResponseEntity uploadFile(@ApiParam(value = "ID of pet } - - @ApiOperation(value = "uploads an image", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImageWithRequiredFile", - 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) { - getRequest().ifPresent(request -> { - 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\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - }