This is my FeignClient:
@FeignClient(name="${mongo.service.id}", url="${mongo.service.url}", configuration = FeignConfig.class)
public interface MongoAtmResetDataInterface {
String requestMappingPrefix = "/api/atmResetData";
@GetMapping(path = requestMappingPrefix + "/brinksDateTime")
LocalDateTime fetchLastBrinksDateTime();
}
This is the call to the feign endpoint:
private String fetchLastBrinksTime() {
return mongoAtmResetDataInterface.fetchLastBrinksDateTime()
.toLocalDate()
.format(DateTimeFormatter.ofPattern(DATE_FORMAT));
}
I get the following exception:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
Cannot construct instance of `java.time.LocalDateTime` (no Creators, like default construct, exist):
no String-argument constructor/factory method to deserialize from String value ('10-12-2019T14:01:39')
I do have a LocalDateTime converter in my SpringMvcConfig class & a contract in my FeignConfig class. Can anyone help- what am I missing?