I have the following method and I need to pass List<UUID>
to this Controller method.
@GetMapping("/product/{productUuidList}")
public ResponseEntity<ApiResponse<List<ProductDTO>>> getProductList(
@RequestParam List<UUID> productUuidList) {
// code omitted
}
If I pass the list parameters by separating comma, it is ok. But, I want to pass these list parameters as Json array. When I try to pass uuid parameters in Postman as shown below, I get "productUuidList parameter is missing" error.
{
"productUuidList": ["c849bcbb-c26c-4299-9ca4-dcde56830f5f", "398ec0f8-86c8-400a-93cb-caf47c1ac92d"]
}
So, how should I properly pass uuid array to this Controller method without changing @GetMapping
to @PostMapping
?