4

I have the following Feign client method:

@GetMapping
    RestPageImpl<CompanyDto> findAllCompanies(@RequestParam(value = "name", required = false) String name, Pageable pageable, @RequestHeader("Authorization") String token);

everything works fine when I pass not nullable pageable object, somehting like:

companyApiClient.findAllCompanies(null, PageRequest.of(0, 10, Sort.by(Sort.Direction.DESC, "c.createdAt")), null);

but in case of:

companyApiClient.findAllCompanies(null, null, null);

it fails with the following exception:

java.lang.IllegalArgumentException: Body parameter 1 was null

    at feign.Util.checkArgument(Util.java:103)

How to allow nullable optional pageable object there?

alexanoid
  • 24,051
  • 54
  • 210
  • 410

0 Answers0