Hi, I got next case with spring boot rest api:
@RestController
@RequestMapping("/my_controller")
class MyController {
@GetMapping(produces = [MediaType.APPLICATION_JSON_VALUE])
fun getIds(@RequestParam(value = "ids") ids: List<Long>): List<Long> = ids
}
when I call for example:
curl -ik localhost:8080/my_controller?ids=1,2,3
all good
but when my client send an empty value for example:
curl -ik localhost:8080/my_controller?ids=1,,3
the list
ids
don't check nullability and my method got
[1,null,3]
I suppose the problem around conversion from java to kotlin cause when I decompile class to java I see next
@NotNull
public List getIds(@RequestParam("ids") @NotNull List ids) {
Intrinsics.checkNotNullParameter(ids, "ids");
there is no any nullability checking, any ideas how to fix it, and where is the root of problem?
thanks.