I have a POST method which accept a Header variable, which is mapped to java.time.OffsetDateTime
in the Java endpoint. But when I try to pass the date for the Header variable in Postman in UTC format like "2019-09-18T20:15:32.162Z" or in timestamp like 1568835908, I get
"status": 400,
"error": "Bad Request",
"message": "Failed to convert value of type 'java.lang.String' to required type 'java.time.OffsetDateTime'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@io.swagger.annotations.ApiParam @org.springframework.web.bind.annotation.RequestHeader java.time.OffsetDateTime] for value '1568835908'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [1568835908]
I know I am passing the Date in wrong way in Postman header. What is the right way?