-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot retrieve messages for given conversation : VonageResponseParseException! #536
Comments
Hello, |
Thanks for raising this, will have this fixed in the next patch release. |
Fixed in v8.9.1, however please note many read-only events in the API are not currently supported, so you will have to query them manually through the |
Hello, I am using the latest java SDK (8.9.0)
Create a conversation with 2 members. : ok
Add simple text message for the 2 members : ok
Try to get all conversation : KO
Following java code :
public void listMessages(ConversationsClient client, String roomId) {
ListEventsRequest request = ListEventsRequest.builder().eventType(EventType.MESSAGE).build();
ListEventsResponse response = client.listEvents(roomId, request);
Stacktrace
Exception in thread "main" com.vonage.client.VonageResponseParseException: Failed to produce ListEventsResponse from JSON.
at com.vonage.client.Jsonable.updateFromJson(Jsonable.java:82)
at com.vonage.client.Jsonable.fromJson(Jsonable.java:128)
at com.vonage.client.DynamicEndpoint.parseResponseSuccess(DynamicEndpoint.java:308)
at com.vonage.client.DynamicEndpoint.parseResponse(DynamicEndpoint.java:244)
at com.vonage.client.AbstractMethod.execute(AbstractMethod.java:82)
at com.vonage.client.conversations.ConversationsClient.listEvents(ConversationsClient.java:363)
at com.vonage.client.conversations.ConversationsClient.listEvents(ConversationsClient.java:348)
at org.example.VonageConversationManager.listMessages(VonageConversationManager.java:74)
at org.example.VonageConversationManager.main(VonageConversationManager.java:105)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type
java.util.ArrayList<com.vonage.client.conversations.Event>
from Object value (tokenJsonToken.START_OBJECT
)at [Source: REDACTED (
StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION
disabled); line: 1, column: 30] (through reference chain: com.vonage.client.conversations.ListEventsResponse["_embedded"])The java response is not complient with the java
public final class ListEventsResponse extends HalPageResponse {
@JsonProperty("_embedded")
private List events;
}
Should have a intermediate object embeded (having a event property) like this :
public final class ListEventsResponse extends HalPageResponse {
@JsonProperty("_embedded")
Embedded embedded;
}
public class Embedded {
}
The text was updated successfully, but these errors were encountered: