I'm creating a a new object of type Fulfillment to use on my webhook and send it as a response. When it gets serialized to Json only the ResponseSpeech is correct, all other types don't. I'm using the gson builder from the SDK.
example:
ResponseSpeech speech = new ResponseMessage.ResponseSpeech();
speech.setSpeech(Arrays.asList("speech 1", "speech 2"));
ResponseImage image = new ResponseMessage.ResponseImage();
image.setImageUrl("url image");
ResponseQuickReply quickReply = new ResponseMessage.ResponseQuickReply();
quickReply.setTitle("Quick title");
(...)
Fulfillment full = new Fulfillment();
full.getMessages(new ArrayList<>());
full.setSpeech("test speech");
full.getMessages().add(card);
full.getMessages().add(image);
full.getMessages().add(quickReply);
full.getMessages().add(speech);
This is the json result:
{"speech":"test speech","messages":[{"type":0},{"type":0},{"type":0},{"speech":["speech 1","speech 2"],"type":0}]}
Other thing: there is no setMessages to the Fulfillment class, this is expected?
I'm creating a a new object of type Fulfillment to use on my webhook and send it as a response. When it gets serialized to Json only the ResponseSpeech is correct, all other types don't. I'm using the gson builder from the SDK.
example:
This is the json result:
{"speech":"test speech","messages":[{"type":0},{"type":0},{"type":0},{"speech":["speech 1","speech 2"],"type":0}]}Other thing: there is no
setMessagesto theFulfillmentclass, this is expected?