Skip to content

Commit

Permalink
Releasing Java SDK 1.4.1
Browse files Browse the repository at this point in the history
- Fixing a bug in Speechlet response where having no shouldEndSession serializes
to true instead of null
  • Loading branch information
Brendan Clement committed Aug 14, 2017
1 parent 4916e9a commit 538ce29
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.amazon.alexa</groupId>
<artifactId>alexa-skills-kit</artifactId>
<packaging>jar</packaging>
<version>1.4.0</version>
<version>1.4.1</version>
<name>Alexa Skills Kit</name>
<description>Contains classes used by the Alexa Skills Kit.</description>
<url>http://developer.amazon.com/ask</url>
Expand Down
21 changes: 21 additions & 0 deletions src/com/amazon/speech/speechlet/SpeechletResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.amazon.speech.ui.Card;
import com.amazon.speech.ui.OutputSpeech;
import com.amazon.speech.ui.Reprompt;
import com.fasterxml.jackson.annotation.*;

/**
* The response to a {@code SpeechletV2} invocation. Defines text to speak to the user, content to
Expand All @@ -35,6 +36,22 @@ public class SpeechletResponse {
private Reprompt reprompt = null;
private Boolean shouldEndSession = true;

/**
* Default public constructor
*/
public SpeechletResponse(){

}

/**
* Constructor used for deserialization
* @param shouldEndSession shouldEndSession
*/
@JsonCreator()
private SpeechletResponse(@JsonProperty("shouldEndSession") Boolean shouldEndSession){
this.shouldEndSession = shouldEndSession;
}

/**
* Returns the speech associated with this response.
*
Expand Down Expand Up @@ -63,6 +80,7 @@ public void setOutputSpeech(final OutputSpeech outputSpeech) {
* @deprecated with version 1.4.0 replaced with {@link #getNullableShouldEndSession()}
*/
@Deprecated
@JsonIgnore
public boolean getShouldEndSession() {
if(shouldEndSession==null) {
return false;
Expand All @@ -80,6 +98,7 @@ public boolean getShouldEndSession() {
* See {@link #setNullableShouldEndSession(Boolean)}
*/
@Deprecated
@JsonIgnore
public void setShouldEndSession(final boolean shouldEndSession) {
this.shouldEndSession = shouldEndSession;
}
Expand All @@ -94,6 +113,8 @@ public void setShouldEndSession(final boolean shouldEndSession) {
*
* @return value of shouldEndSession attribute
*/
@JsonGetter("shouldEndSession")
@JsonInclude(JsonInclude.Include.NON_NULL)
public Boolean getNullableShouldEndSession() {
return shouldEndSession;
}
Expand Down

0 comments on commit 538ce29

Please sign in to comment.