forked from loafle/openapi-generator-original
[kotlin-spring] Handle arrays of files correctly using MultipartFile (#20108)
* [kotlin-spring] Fix no List being used for an array of files using multipart/form-data * [kotlin-spring] Use Spring's MultipartFile class for incoming Files instead of Spring's Resource class. * [kotlin-spring] Add test to ensure that return type for files is `org.springframework.core.io.Resource` * [kotlin-spring] Ensure Array is used for lists of files in generated Api class * Update samples * [kotlin-spring] Move conditional usage of MultipartFile to optionalDataType.mustache. Update samples * update samples --------- Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
parent
b3d172a44f
commit
e131d52ad0
@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
{{#appendRequestToHandler}}
|
{{#appendRequestToHandler}}
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||||
{{/appendRequestToHandler}}
|
{{/appendRequestToHandler}}
|
||||||
@ -33,7 +32,7 @@ interface {{classname}}Delegate {
|
|||||||
/**
|
/**
|
||||||
* @see {{classname}}#{{operationId}}
|
* @see {{classname}}#{{operationId}}
|
||||||
*/
|
*/
|
||||||
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^isFile}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{/isFile}}{{#isFile}}Resource?{{/isFile}}{{^-last}},
|
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{^-last}},
|
||||||
{{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}}{{^skipDefaultDelegateInterface}} {
|
{{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}}{{^skipDefaultDelegateInterface}} {
|
||||||
{{>methodBody}}
|
{{>methodBody}}
|
||||||
}{{/skipDefaultDelegateInterface}}
|
}{{/skipDefaultDelegateInterface}}
|
||||||
|
@ -1 +1 @@
|
|||||||
{{#required}}{{{dataType}}}{{/required}}{{^required}}{{#defaultValue}}{{{dataType}}}{{/defaultValue}}{{^defaultValue}}{{{dataType}}}?{{/defaultValue}}{{/required}}
|
{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}Array<{{/isArray}}org.springframework.web.multipart.MultipartFile{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}?{{/required}}{{/isArray}}{{/isFile}}
|
@ -748,6 +748,75 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenMultipartFormArray_whenGenerateDelegateAndService_thenParameterIsCreatedAsListOfMultipartFile() throws IOException {
|
||||||
|
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||||
|
output.deleteOnExit();
|
||||||
|
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||||
|
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/petstore-with-tags.yaml");
|
||||||
|
final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
|
codegen.setDelegatePattern(true);
|
||||||
|
codegen.setServiceInterface(true);
|
||||||
|
|
||||||
|
ClientOptInput input = new ClientOptInput();
|
||||||
|
input.openAPI(openAPI);
|
||||||
|
input.config(codegen);
|
||||||
|
|
||||||
|
DefaultGenerator generator = new DefaultGenerator();
|
||||||
|
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false");
|
||||||
|
|
||||||
|
generator.opts(input).generate();
|
||||||
|
|
||||||
|
Path delegateFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt");
|
||||||
|
assertFileContains(delegateFile, "additionalMetadata: kotlin.String?");
|
||||||
|
assertFileContains(delegateFile, "images: Array<org.springframework.web.multipart.MultipartFile>");
|
||||||
|
|
||||||
|
Path controllerFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApi.kt");
|
||||||
|
assertFileContains(controllerFile, "images: Array<org.springframework.web.multipart.MultipartFile>");
|
||||||
|
|
||||||
|
|
||||||
|
Path serviceFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiService.kt");
|
||||||
|
assertFileContains(serviceFile, "images: Array<org.springframework.web.multipart.MultipartFile>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenOctetStreamResponseType_whenGenerateServer_thenReturnTypeIsResource() throws IOException {
|
||||||
|
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||||
|
output.deleteOnExit();
|
||||||
|
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||||
|
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/petstore-with-tags.yaml");
|
||||||
|
final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
|
|
||||||
|
ClientOptInput input = new ClientOptInput();
|
||||||
|
input.openAPI(openAPI);
|
||||||
|
input.config(codegen);
|
||||||
|
|
||||||
|
DefaultGenerator generator = new DefaultGenerator();
|
||||||
|
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false");
|
||||||
|
|
||||||
|
generator.opts(input).generate();
|
||||||
|
|
||||||
|
Path outputFilepath = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiController.kt");
|
||||||
|
|
||||||
|
assertFileContains(outputFilepath, "): ResponseEntity<org.springframework.core.io.Resource>");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenMultipartForm_whenGenerateReactiveServer_thenParameterAreCreatedAsRequestPart() throws IOException {
|
public void givenMultipartForm_whenGenerateReactiveServer_thenParameterAreCreatedAsRequestPart() throws IOException {
|
||||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||||
@ -778,7 +847,7 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
assertFileContains(outputFilepath,
|
assertFileContains(outputFilepath,
|
||||||
"@Parameter(description = \"Additional data to pass to server\") @RequestParam(value = \"additionalMetadata\", required = false) additionalMetadata: kotlin.String?");
|
"@Parameter(description = \"Additional data to pass to server\") @RequestParam(value = \"additionalMetadata\", required = false) additionalMetadata: kotlin.String?");
|
||||||
assertFileContains(outputFilepath,
|
assertFileContains(outputFilepath,
|
||||||
"@Parameter(description = \"image to upload\") @Valid @RequestPart(\"image\", required = false) image: org.springframework.core.io.Resource?");
|
"@Parameter(description = \"image to upload\") @Valid @RequestPart(\"image\", required = false) image: org.springframework.web.multipart.MultipartFile");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,13 +8,13 @@ info:
|
|||||||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
servers:
|
servers:
|
||||||
- url: http://petstore.swagger.io/v2
|
- url: http://petstore.swagger.io/v2
|
||||||
tags:
|
tags:
|
||||||
- name: pet
|
- name: pet
|
||||||
description: Everything about your Pets
|
description: Everything about your Pets
|
||||||
- name: store
|
- name: store
|
||||||
description: Access to Petstore orders
|
description: Access to Petstore orders
|
||||||
- name: user
|
- name: user
|
||||||
description: Operations about user
|
description: Operations about user
|
||||||
paths:
|
paths:
|
||||||
/pet:
|
/pet:
|
||||||
@ -36,13 +36,13 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: Pet not found
|
description: Pet not found
|
||||||
content: {}
|
content: { }
|
||||||
405:
|
405:
|
||||||
description: Validation exception
|
description: Validation exception
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
@ -66,7 +66,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
405:
|
405:
|
||||||
description: Invalid input
|
description: Invalid input
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
@ -111,7 +111,7 @@ paths:
|
|||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
400:
|
400:
|
||||||
description: Invalid status value
|
description: Invalid status value
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
@ -152,7 +152,7 @@ paths:
|
|||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
400:
|
400:
|
||||||
description: Invalid tag value
|
description: Invalid tag value
|
||||||
content: {}
|
content: { }
|
||||||
deprecated: true
|
deprecated: true
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
@ -186,12 +186,12 @@ paths:
|
|||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
400:
|
400:
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: Pet not found
|
description: Pet not found
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: [ ]
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
@ -219,7 +219,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
405:
|
405:
|
||||||
description: Invalid input
|
description: Invalid input
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
@ -244,7 +244,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid pet value
|
description: Invalid pet value
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
@ -288,6 +288,73 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
- read:pets
|
- read:pets
|
||||||
|
/pet/{petId}/uploadMultipleImage:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- pet tag
|
||||||
|
summary: uploads multiple images
|
||||||
|
operationId: uploadMultipleFile
|
||||||
|
parameters:
|
||||||
|
- name: petId
|
||||||
|
in: path
|
||||||
|
description: ID of pet to update
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
additionalMetadata:
|
||||||
|
type: string
|
||||||
|
description: Additional data to pass to server
|
||||||
|
required: false
|
||||||
|
images:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: image to upload
|
||||||
|
format: binary
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ApiResponse'
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- write:pets
|
||||||
|
- read:pets
|
||||||
|
/pet/{petId}/getImage:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- pet tag
|
||||||
|
summary: Get an image
|
||||||
|
operationId: getImage
|
||||||
|
parameters:
|
||||||
|
- name: petId
|
||||||
|
in: path
|
||||||
|
description: ID of pet to get image
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/octet-stream:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
format: binary
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- write:pets
|
||||||
|
- read:pets
|
||||||
/store/inventory:
|
/store/inventory:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -306,7 +373,7 @@ paths:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: [ ]
|
||||||
/store/order:
|
/store/order:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
@ -332,7 +399,7 @@ paths:
|
|||||||
$ref: '#/components/schemas/Order'
|
$ref: '#/components/schemas/Order'
|
||||||
400:
|
400:
|
||||||
description: Invalid Order
|
description: Invalid Order
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/store/order/{orderId}:
|
/store/order/{orderId}:
|
||||||
get:
|
get:
|
||||||
@ -364,10 +431,10 @@ paths:
|
|||||||
$ref: '#/components/schemas/Order'
|
$ref: '#/components/schemas/Order'
|
||||||
400:
|
400:
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: Order not found
|
description: Order not found
|
||||||
content: {}
|
content: { }
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- store tag
|
- store tag
|
||||||
@ -385,10 +452,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: Order not found
|
description: Order not found
|
||||||
content: {}
|
content: { }
|
||||||
/user:
|
/user:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
@ -406,7 +473,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/user/createWithArray:
|
/user/createWithArray:
|
||||||
post:
|
post:
|
||||||
@ -426,7 +493,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/user/createWithList:
|
/user/createWithList:
|
||||||
post:
|
post:
|
||||||
@ -446,7 +513,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/user/login:
|
/user/login:
|
||||||
get:
|
get:
|
||||||
@ -490,7 +557,7 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
400:
|
400:
|
||||||
description: Invalid username/password supplied
|
description: Invalid username/password supplied
|
||||||
content: {}
|
content: { }
|
||||||
/user/logout:
|
/user/logout:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -500,7 +567,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content: {}
|
content: { }
|
||||||
options:
|
options:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
@ -509,7 +576,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: endpoint configuration response
|
description: endpoint configuration response
|
||||||
content: {}
|
content: { }
|
||||||
/user/{username}:
|
/user/{username}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -535,10 +602,10 @@ paths:
|
|||||||
$ref: '#/components/schemas/User'
|
$ref: '#/components/schemas/User'
|
||||||
400:
|
400:
|
||||||
description: Invalid username supplied
|
description: Invalid username supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: User not found
|
description: User not found
|
||||||
content: {}
|
content: { }
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
@ -562,10 +629,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid user supplied
|
description: Invalid user supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: User not found
|
description: User not found
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
@ -583,10 +650,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid username supplied
|
description: Invalid username supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: User not found
|
description: User not found
|
||||||
content: {}
|
content: { }
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
Order:
|
Order:
|
||||||
|
@ -110,7 +110,7 @@ interface PetApi {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ class PetApiController() {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,5 +99,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ interface PetApi {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
@ -69,6 +68,6 @@ interface PetApiDelegate {
|
|||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long,
|
fun uploadFile(petId: kotlin.Long,
|
||||||
additionalMetadata: kotlin.String?,
|
additionalMetadata: kotlin.String?,
|
||||||
file: Resource?): ResponseEntity<ModelApiResponse>
|
file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ interface PetApi {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
@ -151,7 +150,7 @@ interface PetApiDelegate {
|
|||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long,
|
fun uploadFile(petId: kotlin.Long,
|
||||||
additionalMetadata: kotlin.String?,
|
additionalMetadata: kotlin.String?,
|
||||||
file: Resource?): ResponseEntity<ModelApiResponse> {
|
file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
getRequest().ifPresent { request ->
|
getRequest().ifPresent { request ->
|
||||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class MultipartMixedApiController() {
|
|||||||
value = ["/multipart-mixed"],
|
value = ["/multipart-mixed"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.core.io.Resource,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity<Unit> {
|
fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.web.multipart.MultipartFile,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity<Unit> {
|
||||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
suspend fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
suspend fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,5 +91,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ interface PetApi {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user