File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
main/kotlin/io/openapiprocessor/spring/writer/java
testInt/resources/tests/params-request-body-multipart-mapping/generated/api Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,14 @@ class MappingAnnotationWriter: CoreMappingAnnotationWriter {
3737 mapping + = " ("
3838 mapping + = " path = " + quote(endpoint.path)
3939
40- if (endpoint.requestBodies.isNotEmpty()) {
40+ val consumes = endpoint.getConsumesContentTypes()
41+ if (consumes.isNotEmpty()) {
4142 mapping + = " , "
42- mapping + = " consumes = {" + quote(endpoint.getRequestBody().contentType) + " }"
43+ mapping + = " consumes = {"
44+ mapping + = consumes.map {
45+ quote(it)
46+ }.joinToString(" , " )
47+ mapping + = ' }'
4348 }
4449
4550 val contentTypes = endpointResponse.contentTypes
Original file line number Diff line number Diff line change 1515
1616public interface Api {
1717
18- @ PostMapping (path = "/multipart/single-file" )
18+ @ PostMapping (
19+ path = "/multipart/single-file" ,
20+ consumes = {"multipart/form-data" })
1921 ResponseEntity <Void > postMultipartSingleFile (
2022 @ RequestParam (name = "file" ) MultipartFile file ,
2123 @ RequestParam (name = "other" ) String other );
2224
23- @ PostMapping (path = "/multipart/multiple-files" )
25+ @ PostMapping (
26+ path = "/multipart/multiple-files" ,
27+ consumes = {"multipart/form-data" })
2428 ResponseEntity <Void > postMultipartMultipleFiles (
2529 @ RequestParam (name = "files" ) MultipartFile [] files ,
2630 @ RequestParam (name = "other" ) String other );
You can’t perform that action at this time.
0 commit comments