mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 20:17:05 +00:00
[FEAT] Support nullable Array<org.springframework.web.multipart.MultipartFile> in Kotlin-Spring generator (#21994)
* Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator - nullable is only supported for MultipartFile. However, Array<MultipartFile> could be also nullable * Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator * Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator Update kotlin-spring-additionalproperties samples
This commit is contained in:
@@ -1 +1 @@
|
||||
{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}Array<{{/isArray}}org.springframework.web.multipart.MultipartFile{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}?{{/required}}{{/isArray}}{{/isFile}}
|
||||
{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}Array<{{/isArray}}org.springframework.web.multipart.MultipartFile{{#isArray}}>{{/isArray}}{{#isNullable}}?{{/isNullable}}{{/isFile}}
|
||||
@@ -370,6 +370,44 @@ public class KotlinSpringServerCodegenTest {
|
||||
"ApiUtil");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testNullableMultipartFile() throws IOException {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
output.deleteOnExit();
|
||||
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||
|
||||
OpenAPI openAPI = new OpenAPIParser()
|
||||
.readLocation("src/test/resources/3_0/kotlin/feat-multipartfile_nullable.yaml", null, new ParseOptions()).getOpenAPI();
|
||||
|
||||
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||
codegen.setOutputDir(output.getAbsolutePath());
|
||||
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "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();
|
||||
|
||||
assertFileContains(Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/NullableMultipartfileApiController.kt"),
|
||||
"file: org.springframework.web.multipart.MultipartFile?)");
|
||||
assertFileContains(Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/NullableMultipartfileArrayApiController.kt"),
|
||||
"files: Array<org.springframework.web.multipart.MultipartFile>?)");
|
||||
assertFileContains(Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/NonNullableMultipartfileApiController.kt"),
|
||||
"file: org.springframework.web.multipart.MultipartFile)");
|
||||
assertFileContains(Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/NonNullableMultipartfileArrayApiController.kt"),
|
||||
"files: Array<org.springframework.web.multipart.MultipartFile>)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void arrayItemsCanBeNullable() throws IOException {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
openapi: 3.0.0
|
||||
servers:
|
||||
- url: 'https://example.org/v1'
|
||||
info:
|
||||
description: >-
|
||||
Example created for nullable multipartfile issue
|
||||
version: 1.0.0
|
||||
title: OpenAPI Stuff API created to reproduce issue
|
||||
license:
|
||||
name: Apache-2.0
|
||||
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
|
||||
tags:
|
||||
- name: multipartfile
|
||||
description: All about the nullable multipartfile
|
||||
security:
|
||||
- bearerAuth: []
|
||||
paths:
|
||||
/nullable-multipartfile:
|
||||
post:
|
||||
tags:
|
||||
- multipartfile
|
||||
summary: simple nullable multipartfile
|
||||
operationId: testNullableMultipartfile
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
file:
|
||||
type: string
|
||||
description: File to upload
|
||||
format: binary
|
||||
nullable: true
|
||||
jsonPayload:
|
||||
type: object
|
||||
description: simple json payload
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
required:
|
||||
- jsonPayload
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
'400':
|
||||
description: Invalid status value
|
||||
|
||||
/nullable-multipartfile-array:
|
||||
post:
|
||||
tags:
|
||||
- multipartfile
|
||||
summary: simple nullable multipartfile
|
||||
operationId: testNullableMultipartfile
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: File to upload
|
||||
format: binary
|
||||
nullable: true
|
||||
jsonPayload:
|
||||
type: object
|
||||
description: simple json payload
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
required:
|
||||
- jsonPayload
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
'400':
|
||||
description: Invalid status value
|
||||
/non-nullable-multipartfile:
|
||||
post:
|
||||
tags:
|
||||
- multipartfile
|
||||
summary: simple non nullable multipartfile
|
||||
operationId: testNonNullableMultipartfile
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
file:
|
||||
type: string
|
||||
description: File to upload
|
||||
format: binary
|
||||
nullable: false
|
||||
jsonPayload:
|
||||
type: object
|
||||
description: simple json payload
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
required:
|
||||
- jsonPayload
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
'400':
|
||||
description: Invalid status value
|
||||
|
||||
/non-nullable-multipartfile-array:
|
||||
post:
|
||||
tags:
|
||||
- multipartfile
|
||||
summary: simple non nullable multipartfile
|
||||
operationId: testNonNullableMultipartfile
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: File to upload
|
||||
format: binary
|
||||
nullable: false
|
||||
jsonPayload:
|
||||
type: object
|
||||
description: simple json payload
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
required:
|
||||
- jsonPayload
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
'400':
|
||||
description: Invalid status value
|
||||
externalDocs:
|
||||
description: Find out more about Swagger
|
||||
url: 'http://swagger.io'
|
||||
components:
|
||||
securitySchemes:
|
||||
bearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
schemas:
|
||||
Stuff:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
|
||||
@@ -110,7 +110,7 @@ interface PetApi {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ class PetApiController() {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @Valid @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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,5 +99,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,5 +99,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ interface PetApi {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @Valid @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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,6 @@ interface PetApiDelegate {
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long,
|
||||
additionalMetadata: kotlin.String?,
|
||||
file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse>
|
||||
file: org.springframework.web.multipart.MultipartFile): ResponseEntity<ModelApiResponse>
|
||||
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ interface PetApi {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @Valid @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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ interface PetApiDelegate {
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long,
|
||||
additionalMetadata: kotlin.String?,
|
||||
file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
file: org.springframework.web.multipart.MultipartFile): ResponseEntity<ModelApiResponse> {
|
||||
getRequest().ifPresent { request ->
|
||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||
|
||||
@@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,5 +90,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
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") @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,5 +100,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
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") @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,5 +100,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ interface PetApi {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @Valid @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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,5 +90,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,5 +90,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
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") @Valid @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> {
|
||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,5 +90,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,5 +95,5 @@ interface PetApi {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse>
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile): ResponseEntity<ModelApiResponse>
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
produces = ["application/json"],
|
||||
consumes = ["multipart/form-data"]
|
||||
)
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @Valid @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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,5 +90,5 @@ interface PetApiService {
|
||||
* @return successful operation (status code 200)
|
||||
* @see PetApi#uploadFile
|
||||
*/
|
||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): 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")
|
||||
}
|
||||
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile): ModelApiResponse {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user