I have a rest API with an input value which is an epoch. However, storing as an Instant ignores the nanos, thus storing it as some date in the future (I think). I could be storing them in the wrong type also as had thought about storing them as a long either.
Example: From the input of 683124845000 I am expecting a date and time in 1991. It is converted to +23617-05-13T13:23:20Z.
public class Booking {
private Instant epoch;
private String email;
}
The JSON input is:
{
"epoch": "683124845000",
"email": "email@email.com"
}
Currently, I just have a controller that returns OK regardless of input as I am modeling the input.
@PostMapping("/booking")
public ResponseEntity createBooking(@RequestBody Booking booking) {
return ResponseEntity.ok().build();
}