Giter Site home page Giter Site logo

alexa / alexa-apis-for-java Goto Github PK

View Code? Open in Web Editor NEW
30.0 30.0 21.0 2.67 MB

The Alexa APIs for Java consists of JAVA POJO classes that represent the request and response JSON of Alexa services. These models act as core dependency for the Alexa Skills Kit Java SDK (https://github.com/alexa/alexa-skills-kit-sdk-for-java ).

License: Apache License 2.0

Java 100.00%
alexa alexa-apis java sdk skills

alexa-apis-for-java's People

Contributors

abhjroy avatar ask-sdk avatar breedloj avatar dependabot[bot] avatar doiron avatar nikhilym avatar rahulawl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alexa-apis-for-java's Issues

Unable to instantiate any APL command classes

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request (generic to all classes)
[ ] Documentation issue or request
[ ] Other... Please describe:

Attempting to instantiate any subclass of com.amazon.ask.model.interfaces.alexa.presentation.apl.Command fails with a NullPointerException.

Expected Behavior

I should be able to instantiate a command class correctly, For example, the following code should complete successfully:
IdleCommand command = IdleCommand.builder().withDelay(42).build();

Current Behavior

The above code throws a NullPointerException.

Possible Solution

The issue appears to be from commit bddf618, which introduced String.valueOf(null) as the default value for the delay field. String.valueOf(null) is not correct code as it will always throw a NullPointerException. This default value should be removed.

Steps to Reproduce (for bugs)

// Provide a self-contained, concise snippet of code using the SDK.
// For more complex issues provide a repo with the smallest sample that reproduces the bug
// Including business logic or unrelated code makes diagnosis more difficult

See above example.

Context

This bug is fairly critical as it prevents the use of any APL commands via alexa/alexa-skills-kit-sdk-for-java version 2.20.0 or later, which relies on this library.

Your Environment

  • ASK SDK Models for Java used: 1.18.0
  • ASK SDK for Java used: 2.20.0
  • Operating System and version: macOS 10.14.5 / OpenJDK 11.0.2

UpsServiceClient never gets a response

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request (generic to all classes)
[ ] Documentation issue or request
[ X] Other... Please describe: The service never provides a response

When I invoke the UpsServiceClient, I never get a response from api.amazonalexa.com

Expected Behavior

Ideally, I would get a response with Customer Profile data, or I would get some error of some kind

Current Behavior

Right now the service call goes out into the ether, and never returns anything back. Eventually, the Lambda will timeout. Below are my logs from Cloudwatch

01:36:48.023 [main] DEBUG com.amazon.ask.dispatcher.impl.DefaultRequestDispatcher - [amzn1.echo-api.request.448fc2b6-562a-48df-aac0-8ec6ad0128ee] Found compatible adapter com.amazon.ask.dispatcher.request.handler.impl.DefaultHandlerAdapter
01:36:48.121 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
01:36:48.143 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
01:36:48.144 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://api.amazonalexa.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
01:36:48.202 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->https://api.amazonalexa.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
01:36:48.204 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {s}->https://api.amazonalexa.com:443
01:36:48.224 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to api.amazonalexa.com/52.85.135.22:443
01:36:48.224 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Connecting socket to api.amazonalexa.com/52.85.135.22:443 with timeout 0
END RequestId: 217abb47-c388-11e8-a0df-935086f1315b
REPORT RequestId: 217abb47-c388-11e8-a0df-935086f1315b Duration: 61052.77 ms Billed Duration: 61000 ms Memory Size: 512 MB Max Memory Used: 70 MB
2018-09-29T01:37:49.008Z 217abb47-c388-11e8-a0df-935086f1315b Task timed out after 61.05 seconds

Possible Solution

// Not required, but suggest a fix/reason for the bug,
// or ideas how to implement the addition or change

// A working skill sample code using the SDK is recommended.

Steps to Reproduce (for bugs)

// Provide a self-contained, concise snippet of code using the SDK.
// For more complex issues provide a repo with the smallest sample that reproduces the bug
// Including business logic or unrelated code makes diagnosis more difficult

Context

@Override
public Optional<Response> handle(HandlerInput input) {
    String apiEndpoint = input.getRequestEnvelope().getContext().getSystem().getApiEndpoint();

    DefaultApiConfiguration defaultApiConfiguration =
            DefaultApiConfiguration.builder()
                    .withApiEndpoint(apiEndpoint)
                    .withApiClient(ApacheHttpApiClient.standard())
                    .build();
    ServiceClientFactory build =
            ServiceClientFactory
                    .builder()
                    .withDefaultApiConfiguration(defaultApiConfiguration).build();
    UpsServiceClient upsService = build.getUpsService();
    String email = upsService.getProfileEmail();

        // Build a response with output speech and a LinkAccount card.
    return input.getResponseBuilder()
            .withSpeech(email)
            .withReprompt(email)
            .build();
}

Your Environment

Java
AWS Lambda
Compiled on AWS Codebuild
ASK SDK Models for Java used: 1.6.0

  • ASK SDK for Python used: x.x.x
  • Operating System and version:

Python version info

  • Python version used for development:

Calling getSystemTimeZone() results in a nullpointer exception

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request (generic to all classes)
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

Calling getSystemTimeZone() from UpsServiceClass should return the current timezone or at least throw a ServiceException if there is no permission to access the timezone.

Current Behavior

By calling
RequestHelper helper = RequestHelper.forHandlerInput(this.handlerInput); this.handlerInput.getServiceClientFactory().getUpsService().getSystemTimeZone(helper.getDeviceId())

a NullpointerException is thrown with the current stack trace:

Result: Failure
Exception: NullPointerException:
Stack: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.microsoft.azure.functions.worker.broker.JavaMethodInvokeInfo.invoke(JavaMethodInvokeInfo.java:22)
at com.microsoft.azure.functions.worker.broker.JavaMethodExecutor.execute(JavaMethodExecutor.java:54)
at com.microsoft.azure.functions.worker.broker.JavaFunctionBroker.invokeMethod(JavaFunctionBroker.java:51)
at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:33)
at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:10)
at com.microsoft.azure.functions.worker.handler.MessageHandler.handle(MessageHandler.java:45)
at com.microsoft.azure.functions.worker.JavaWorkerClient$StreamingMessagePeer.lambda$onNext$0(JavaWorkerClient.java:92)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.amazon.ask.exception.UnhandledSkillException: Unhandled exception
at com.amazon.ask.request.dispatcher.impl.BaseRequestDispatcher.dispatch(BaseRequestDispatcher.java:79)
at com.amazon.ask.CustomSkill.invoke(CustomSkill.java:101)
at com.amazon.ask.CustomSkill.invoke(CustomSkill.java:70)
at com.amazon.ask.CustomSkill.invoke(CustomSkill.java:66)
at de.chelbterem.MySkill.handle(MySkill.java:76)
at de.chelbterem.Function.run(Function.java:80)
... 16 more
Caused by: java.lang.NullPointerException
at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:889)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004)
at com.amazon.ask.util.JacksonSerializer.deserialize(JacksonSerializer.java:69)
at com.amazon.ask.model.services.BaseServiceClient.invoke(BaseServiceClient.java:109)
at com.amazon.ask.model.services.BaseServiceClient.invoke(BaseServiceClient.java:60)
at com.amazon.ask.model.services.ups.UpsServiceClient.getSystemTimeZone(UpsServiceClient.java:225)
at de.chelbterem.Profile.initialize(Profile.java:86)
at de.chelbterem.interceptors.ProfileInterceptor.process(ProfileInterceptor.java:21)
at de.chelbterem.interceptors.ProfileInterceptor.process(ProfileInterceptor.java:13)
at com.amazon.ask.request.dispatcher.impl.BaseRequestDispatcher.doDispatch(BaseRequestDispatcher.java:87)
at com.amazon.ask.request.dispatcher.impl.BaseRequestDispatcher.dispatch(BaseRequestDispatcher.java:72)
... 21 more

Possible Solution

Calling the method should not return in an error / NullpointerException.

Steps to Reproduce (for bugs)

RequestHelper helper = RequestHelper.forHandlerInput(this.handlerInput); this.handlerInput.getServiceClientFactory().getUpsService().getSystemTimeZone(helper.getDeviceId())

Context

I want to greet the user of alexa with a timezone-sensitive personalized speech text. Therefore I would like to access the users timezone in order to get the right time.

Additionally, I am currently hosting my java alexa skill as an Azure function in Java.

Your Environment

  • ASK SDK Models for Java used: 2.19
  • ASK SDK for Java used: 2.19
  • Operating System and version: Windows 10 (Build 17763.557)
  • Azure Functions Java Library used: 1.3.0

Navigation.SetDestination is missing

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request (generic to all classes)
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

Navigation.SetDestination directive type offered and present in
com.amazon.ask.model.interfaces.navigation package

Current Behavior

Currently the Navigation.SetDestination directive type is not offered as a valid type in the Directive type.

Steps to Reproduce (for bugs)

Try to create Navigation.SetDestination request type.

Context

Your Environment

  • ASK SDK Models for Java used: 1.29.0
  • ASK SDK for Java used: 2.31.0
  • Operating System and version: Ubuntu 20.04.1

AudioTrack enum missing values: BACKGROUND and NONE

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request (generic to all classes)
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

I should be able to set desired PlayMediaCommand#audioTrack value from FOREGROUND, BACKGROUND, NONE when building a response with ExecuteCommandsDirective.

Current Behavior

Current AudioTrack enum (ask-sdk-model version 1.38.0) contains only FOREGROUND and UNKNOWN_TO_SDK_VERSION values.

Possible Solution

// Not required, but suggest a fix/reason for the bug,
// or ideas how to implement the addition or change

// A working skill sample code using the SDK is recommended.
Refreshing JSON schema used to generate ask-sdk-model classes.

Steps to Reproduce (for bugs)

// Provide a self-contained, concise snippet of code using the SDK.
// For more complex issues provide a repo with the smallest sample that reproduces the bug
// Including business logic or unrelated code makes diagnosis more difficult
(missing enum values cannot be reproduced in code)

Context

I want to have full control over Video component from custom skill code - audioTrack property with complete values list is essential.

Your Environment

  • ASK SDK Models for Java used: 1.38.0
  • ASK SDK for Java used: 2.42.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.