In my case JsonDeserialize works well in TournamentRequestDTO and PrizeInfo, but not working inside PrizeGroup. Not sure where problem is and what I am doing wrong. I also tried to make custom setters inside these classes – same issue, setters not working in PrizeGroup, but works well in TournamentRequestDTO and PrizeInfo.
@Getter
@Setter
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class TournamentRequestDTO {
@JsonProperty("name")
private String name;
@JsonProperty("gameplayMode")
@JsonDeserialize(using = EnumDeserializer.class)
private TournamentGameplayMode gameplayMode;
@JsonProperty("prizesInfo")
private @Valid PrizeInfo prizeInfo;
...
@Getter
@Setter
@AllArgsConstructor
public static class PrizeInfo {
@JsonProperty("currency")
@JsonDeserialize(using = EnumDeserializer.class)
private TournamentCurrency currency;
@JsonProperty("prizes")
private List<@Valid PrizeGroup> prizes;
...
@Getter
@Setter
@AllArgsConstructor
public static class PrizeGroup {
@JsonProperty("type")
@JsonDeserialize(using = PrizeTypeEnumDeserializer.class)
private PrizeType type;
@JsonProperty("name")
private String name;
...
}
}
}
I tried to modify deserializators, I tried to write setters inside PrizeGroup, I tried to use one prize instead of list – breakpoints not triggered, Jackson using default inner methods inside PrizeGroup an I can overwrite them to use my custom classes and methods.