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

new Fulfillment for webhook response #12

Description

@marcioluis

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions