Closed sanchayddun closed 1 year ago
@JsonFormat
annotation should not be a problem, and @JsonDeserialize
annotation looks legit.
What I would suggest checking is use of Lombok: perhaps it changes annotations during processing it does?
Alternatively if you can create a test case that does NOT use Lombok I could have a look (I do not troubleshoot reproductions with Lombok as an additional dependency -- but if you can get class definition after Lombok processing that'd be fine too).
At this point I cannot reproduce the issue: we would need a test case without Lombok (using class definition after Lombok has processed it). It is likely that there is a Lombok setting to make sure annotations get properly copied/added to generated classes, but I am not familiar enough with it to help.
Closing; may be re-opened/filed with a reproduction showing the issue without Lombok (or other 3rd party lib/framework) dependency.
I have a class
And I wrote a customDeserializer for one property birthDate which is of type LocalDate.
My use case is that the property birthDate can be of format dd-MM-yyyy or yyyy-MM-dd. Hence I tried to parse it using both patterns. But there seems to be some issue in this, the deserialize method is not being invoked. I also tried removing the @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") line from it, then also same issue is occuring. Can anyone help me? Or what am I doing wrong here?