Closed kenpaulsen closed 6 years ago
Meanwhile you can wrap SpeechletResponse in your own class and override getShouldEndSession.
@Override @JsonInclude public boolean getShouldEndSession() { return super.getShouldEndSession(); }
See an example of a wrapper, which is also way better to build SpeechletResponse like
final SpeechletResponse response = AlexaSpeechletResponse .ask() .withSsml("Some <p>SSML</p>") .withRepromptText("Some reprompt text.") .withSimpleCardContent("Some card content.") .withSimpleCardTitle("A card's title") .build();
Have fun: https://gist.github.com/KayLerch/8bfcb2d3b895e0bfccaf34d8f8550e9e
Thanks Kay! Yes, I overrode SpeechletResponse and did something very similar in my code to work around this.
Also your fluent builder looks great!
We faced this issue when using the alexa-skills-kit 1.1.3 with the aws-java-sdk-core 1.11.0 jar. The aws-java-sdk-core pulls in jackson-databind 2.5.3 which cannot handle the above annotation, whereas alexa-skills-kit 1.1.3 pulls in jackson-databind 2.3.2, which can handle the Include.NON_DEFAULT
annotation value.
In our gradle build script, we simply excluded the jackson-databind transitive dependency from the aws jars, and have had no issues since then.
Closing due to inactivity but please feel free to reopen if this issue persists!
The "default" for a
boolean
isfalse
, regardless of the "initial" value set by the class. The effect of adding the@JsonInclude(Include.NON_DEFAULT)
annotation means that anytime thesetShouldEndSession(...)
method is called withfalse
, this property will be omitted from the JSON output. When deserialized, it will pickup the "initial" value oftrue
... meaning with this annotation set, this property is effectivelytrue
after deserialization regardless of its original value.One fix is to simply remove this annotation.
The error is on this line: https://github.com/amzn/alexa-skills-kit-java/blob/master/src/com/amazon/speech/speechlet/SpeechletResponse.java#L57