{"action":"created","issue":{"url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-java/issues/149","repository_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-java","labels_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-java/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-java/issues/149/comments","events_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-java/issues/149/events","html_url":"https://github.com/alexa/alexa-skills-kit-sdk-for-java/issues/149","id":367274909,"node_id":"MDU6SXNzdWUzNjcyNzQ5MDk=","number":149,"title":"Provide an Optional<String>getSlot(String slotName) method","user":{"login":"paulschuetz","id":23276497,"node_id":"MDQ6VXNlcjIzMjc2NDk3","avatar_url":"https://avatars2.githubusercontent.com/u/23276497?v=4","gravatar_id":"","url":"https://api.github.com/users/paulschuetz","html_url":"https://github.com/paulschuetz","followers_url":"https://api.github.com/users/paulschuetz/followers","following_url":"https://api.github.com/users/paulschuetz/following{/other_user}","gists_url":"https://api.github.com/users/paulschuetz/gists{/gist_id}","starred_url":"https://api.github.com/users/paulschuetz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulschuetz/subscriptions","organizations_url":"https://api.github.com/users/paulschuetz/orgs","repos_url":"https://api.github.com/users/paulschuetz/repos","events_url":"https://api.github.com/users/paulschuetz/events{/privacy}","received_events_url":"https://api.github.com/users/paulschuetz/received_events","type":"User","site_admin":false},"labels":[{"id":751715446,"node_id":"MDU6TGFiZWw3NTE3MTU0NDY=","url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-java/labels/feature%20request","name":"feature request","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-05T16:05:10Z","updated_at":"2018-11-30T22:44:49Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n## I'm submitting a...\r\n<!-- Check one of the following options with \"x\" -->\r\n<pre><code>[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Performance issue\r\n[x ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Other... Please describe:\r\n</code></pre>\r\n\r\n<!--- Provide a general summary of the issue in the Title above -->\r\n\r\n## Expected Behavior\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\nIntentRequest exposes a Optional<String>getSlot(String slotName) method to easily access the slot values and react on their absence.\r\n## Current Behavior\r\n<!--- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!--- Include full errors, uncaught exceptions, stack traces, and relevant logs -->\r\n<!--- If service responses are relevant, please include any -->\r\n<!--- If suggesting a change/improvement, explain the difference from current behavior -->\r\nRight now you have to write 4 lines of code in order to retrieve a slot value.\r\n\r\n## Steps to Reproduce (for bugs)\r\n```\r\n        IntentRequest intent = (IntentRequest) handlerInput.getRequestEnvelope().getRequest();\r\n        Slot nameSlot = intent.getIntent().getSlots().get(Slots.NAME);\r\n        if (nameSlot == null || nameSlot.getValue()==null) return getNoNameSpecifiedResponse(handlerInput);\r\n        String name = nameSlot.getValue();\r\n```\r\n## Possible Solution\r\nProvide a Optional<String> getSlot(String slotname) method\r\n## Your Environment\r\n<!--- Include as many relevant details about the environment where the bug was discovered -->\r\n* ASK Java SDK version used: 2.7.1\r\n* Operating System and version: Windows 10\r\n\r\n## Java Info\r\n<!--- For Java issues, please provide the following -->\r\n* Java version used for development: Java 8\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-java/issues/comments/443362436","html_url":"https://github.com/alexa/alexa-skills-kit-sdk-for-java/issues/149#issuecomment-443362436","issue_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-java/issues/149","id":443362436,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzM2MjQzNg==","user":{"login":"breedloj","id":14608226,"node_id":"MDQ6VXNlcjE0NjA4MjI2","avatar_url":"https://avatars1.githubusercontent.com/u/14608226?v=4","gravatar_id":"","url":"https://api.github.com/users/breedloj","html_url":"https://github.com/breedloj","followers_url":"https://api.github.com/users/breedloj/followers","following_url":"https://api.github.com/users/breedloj/following{/other_user}","gists_url":"https://api.github.com/users/breedloj/gists{/gist_id}","starred_url":"https://api.github.com/users/breedloj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breedloj/subscriptions","organizations_url":"https://api.github.com/users/breedloj/orgs","repos_url":"https://api.github.com/users/breedloj/repos","events_url":"https://api.github.com/users/breedloj/events{/privacy}","received_events_url":"https://api.github.com/users/breedloj/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T22:44:49Z","updated_at":"2018-11-30T22:44:49Z","author_association":"CONTRIBUTOR","body":"Release 2.9.1 makes typed request handler interfaces available to give skill developers a type safe way to write handlers for a particular type of request. For example, you can implement the [IntentRequestHandler interface](https://github.com/alexa/alexa-skills-kit-sdk-for-java/blob/2.0.x/ask-sdk-core/src/com/amazon/ask/dispatcher/request/handler/impl/IntentRequestHandler.java) to handle one or more of your skill's intents. `instanceof` checks and casts are not necessary when using these type specific interfaces. We will continue to look at ways to improve access to nested request attributes, but I'm hopeful that this change greatly improves the intuitiveness of writing request handling logic."}}
{"actor":{"display_login":"breedloj"}}