I am trying to pass LocalDateTime in the request param of a method but it always logs null. Please help me figure out what I did wrong here:
@Path("/book/workOrderId/{workOrderId}")
@PUT
public Response bookWorkOrder(@Context HttpHeaders headers, @PathParam("countryCode") String countryCode,
@PathParam("workOrderId") int workOrderId,
@QueryParam("reasonId") int reasonId,
@RequestParam(value = "dateTime") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") LocalDateTime dateTime
) throws CDException {
logger.debug("dateTime outside if::" + dateTime);
return Response.ok(true).build();
}
Output:
22:32:27.659 [http-nio-8300-exec-2] DEBUG c.c.t.i.e.v.impl.WorkorderController - dateTime outside if::null