Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

MessageType deserialization issue #30

Closed
arsenalol1 opened this issue Jul 24, 2017 · 2 comments
Closed

MessageType deserialization issue #30

arsenalol1 opened this issue Jul 24, 2017 · 2 comments

Comments

@arsenalol1
Copy link

arsenalol1 commented Jul 24, 2017

Hi !

I encoutred a problem with deserialization of the attribute ResponseMessage.type . When I deserialize a Json like this one :
"fulfillment": { "speech": "Howdy.", "messages": [ { "type": 0, "speech": "Howdy." } ] },
the attribute 'type' of ResponseMessage.ResponseSpeech is null.
Here is my code :
ResponseSpeech re = (ResponseSpeech)GsonFactory.getDefaultFactory().getGson().fromJson("{ \"speech\": \"Hey!\",\"messages\": [{\"type\": 0,\"speech\": \"Howdy.\" }]}", Fulfillment.class).getMessages().get(0);

Thanks !

@folomeev
Copy link
Contributor

The field ResponseMessage.type is private and not supposed to be used outside of the class.

How do you use it?

@arsenalol1
Copy link
Author

I checked the value with the debugger ^^.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants