diff --git a/src/main/java/com/whatsapp/api/WhatsappApiServiceGenerator.java b/src/main/java/com/whatsapp/api/WhatsappApiServiceGenerator.java index 13ee804d9..be27b8d31 100644 --- a/src/main/java/com/whatsapp/api/WhatsappApiServiceGenerator.java +++ b/src/main/java/com/whatsapp/api/WhatsappApiServiceGenerator.java @@ -30,7 +30,11 @@ public class WhatsappApiServiceGenerator { static OkHttpClient sharedClient; private static final Converter.Factory converterFactory = JacksonConverterFactory.create( - new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, false) + .configure(DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS, false) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false) ); @SuppressWarnings("unchecked") diff --git a/src/main/java/com/whatsapp/api/exception/WhatsappApiException.java b/src/main/java/com/whatsapp/api/exception/WhatsappApiException.java index f601507b7..1f32c712c 100644 --- a/src/main/java/com/whatsapp/api/exception/WhatsappApiException.java +++ b/src/main/java/com/whatsapp/api/exception/WhatsappApiException.java @@ -51,4 +51,8 @@ public String getMessage() { return super.getMessage(); } + public WhatsappApiError getError() { + return whatsappApiError; + } + }