alexa / alexa-skills-kit-sdk-for-java

The Alexa Skills Kit SDK for Java helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
http://developer.amazon.com/ask
Apache License 2.0
815 stars 748 forks source link

Add response interceptor method for returning modified response #209

Closed breedloj closed 5 years ago

breedloj commented 5 years ago

Description

Adds a new response interceptor method that allows the interceptor to return an updated response. This method has a default implementation in the interface to retain backwards compatibility. The existing method has also been made default, and I will likely mark it deprecated at some point in the future. The new method is now called by the dispatcher, which by default will proxy it to the existing method unless overridden in the user's interceptor implementation.

The other approach would be to introduce an entirely new response interceptor interface which would in some ways be a cleaner solution, but was not chosen due to discoverability concerns and loss of parity with other language SDKs.

Motivation and Context

This change is in response to #206 where a customer wants the ability to update the response as part of their response interceptor logic.

Testing

Types of changes

Checklist

License