https://kotlinlang.org logo
#spring
Title
s

SecretX

02/06/2022, 9:09 PM
Is there any functional difference between
Copy code
@PostMapping
suspend fun uploadFile(@RequestParam file: Mono<FilePart>)
and
Copy code
@PostMapping
suspend fun uploadFile(@RequestParam file: FilePart)
other than maybe allow the former to not pass any value?
r

Richard Gomez

02/07/2022, 9:01 PM
Does your first example actually work? I was under the impression that Spring 'translated' Mono/Flux to suspend variants behind the scenes. e.g.
Copy code
@PostMapping
fun uploadFile(@RequestParam file: Mono<FilePart>)
to
Copy code
@PostMapping
suspend fun uploadFile(@RequestParam file: FilePart)
7 Views