From 66f3be344c65e52c75794219c686bf37754bd168 Mon Sep 17 00:00:00 2001 From: Stein Desmet Date: Tue, 2 Jan 2024 14:35:43 +0100 Subject: [PATCH] Also ignore unknown fields on message responses --- .../java/com/whatsapp/api/domain/messages/response/Contact.java | 2 ++ .../java/com/whatsapp/api/domain/messages/response/Message.java | 2 ++ .../whatsapp/api/domain/messages/response/MessageResponse.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/main/java/com/whatsapp/api/domain/messages/response/Contact.java b/src/main/java/com/whatsapp/api/domain/messages/response/Contact.java index 877e2b914..4c95f1e35 100644 --- a/src/main/java/com/whatsapp/api/domain/messages/response/Contact.java +++ b/src/main/java/com/whatsapp/api/domain/messages/response/Contact.java @@ -1,5 +1,6 @@ package com.whatsapp.api.domain.messages.response; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -7,6 +8,7 @@ * The type Contact. */ @JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) public record Contact( @JsonProperty("input") String input, diff --git a/src/main/java/com/whatsapp/api/domain/messages/response/Message.java b/src/main/java/com/whatsapp/api/domain/messages/response/Message.java index 1208cdde3..24d48bb03 100644 --- a/src/main/java/com/whatsapp/api/domain/messages/response/Message.java +++ b/src/main/java/com/whatsapp/api/domain/messages/response/Message.java @@ -1,5 +1,6 @@ package com.whatsapp.api.domain.messages.response; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -7,6 +8,7 @@ * The type Message. */ @JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) public record Message( @JsonProperty("id") String id) { diff --git a/src/main/java/com/whatsapp/api/domain/messages/response/MessageResponse.java b/src/main/java/com/whatsapp/api/domain/messages/response/MessageResponse.java index 78f2c5d72..03f375ce2 100644 --- a/src/main/java/com/whatsapp/api/domain/messages/response/MessageResponse.java +++ b/src/main/java/com/whatsapp/api/domain/messages/response/MessageResponse.java @@ -1,5 +1,6 @@ package com.whatsapp.api.domain.messages.response; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -9,6 +10,7 @@ * The type Message response. */ @JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) public record MessageResponse( @JsonProperty("messaging_product") String messagingProduct,