Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a new item to a list (e.g. shopping list) returns validation error #112

Closed
zHPhil93 opened this issue May 30, 2018 · 3 comments
Closed
Labels

Comments

@zHPhil93
Copy link

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
[ ] Documentation issue or request
[ ] Other... Please describe:

For adding a new list item to Alexa's internal shopping list, i use the following code:

ListManagementServiceClient listClient = input.getServiceClientFactory().getListManagementService();
 listClient.createListItem(listID, CreateListItemRequest.builder()
                  .withStatus(ListItemState.ACTIVE)
                  .withValue("test value")
                  .build());

If i try the execution with the code above i get the following error:
message: 1 validation error detected: Value 'ACTIVE' at 'item.status' failed to satisfy constraint: Member must satisfy enum value set: [active, completed]

I do not see anything wrong with my code to create a list item. Therefore i guess there is a bug in the alexa skills kit sdk for java.

Expected Behavior

A new item with the value "test value" and the status "ACTIVE" should be added to the alexa list (with id = listID) of the user.

Current Behavior

Currently the skills kit returns a validation error, because the item.status with the value "ACTIVE" is not in the enum value set of [active, completed]. Therefore the list item is not created.

Steps to Reproduce (for bugs)

 ListManagementServiceClient listClient = input.getServiceClientFactory().getListManagementService();
    listClient.createListItem(listID, CreateListItemRequest.builder()
                     .withStatus(ListItemState.ACTIVE)
                     .withValue("test value")
                     .build());

Possible Solution

Context

I found no other way i could add a list item to e.g. the alexa shopping list or the to-do-list with the java sdk. If there is another, i am fine with that, but would like to get some documentation on it.

Your Environment

  • ASK Java SDK version used: 2.3.0
  • Operating System and version:

Java Info

  • Java version used for development: Java 8
@sungolivia sungolivia added the bug label May 31, 2018
@breedloj
Copy link
Contributor

Thanks for reporting this issue. SDK version 2.3.1 contains a fix. Feel free to let us know if you continue to experience this, or other issues.

@allusai
Copy link

allusai commented May 31, 2018

Hello there!

I think someone had expressed a similar issue in this discussion forum: https://forums.aws.amazon.com/thread.jspa?threadID=175775.

From what I understand, the problem isn't how you are adding an item to a list, but rather with how you set up the DynamoDB table. When you write the AttributeDefinitions for an Attribute, you only should give an AttributeDefinition to primary key Attributes. So somewhere in your code you might be assigning an attribute definition to a non-primary key attribute.

Let me know if this works!
Sai

@zHPhil93
Copy link
Author

zHPhil93 commented May 31, 2018

Hi,

thanks for your feedback. The bug is fixed with version 2.3.1, as @breedloj stated.
The forum link provided by @allusai is a completely different topic. I am not using any DynamoDB table, i just want to add an item to the shopping list of the customer.

Thanks for your quick help!
Philipp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants