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

DynamoDB API regression between 1.17.0 and 1.18.0 #226

Closed
mlogan opened this issue Feb 5, 2014 · 4 comments
Closed

DynamoDB API regression between 1.17.0 and 1.18.0 #226

mlogan opened this issue Feb 5, 2014 · 4 comments

Comments

@mlogan
Copy link

mlogan commented Feb 5, 2014

With aws-sdk@1.17.0, I can make the following call to delete an attribute from a dynamoDB row:

updateItem({
  "TableName":"mutationTest.LOCAL",
  "Key":{"id":{"S":"1234567"}},
  "Expected":{"id":{"Exists":true,"Value":{"S":"1234567"}}},
  "AttributeUpdates":{"name":{"Action":"DELETE","Value":null}}
})

Note that AttributeUpdates contains a Value property which is set to null.

After upgrading to aws-sdk@1.18.0, I get the following error when making the above call:

ValidationException: Key datatypes must be scalars, not sets

In order to fix my application, I have to change the call to look like this:

updateItem({
  "TableName":"mutationTest.LOCAL",
  "Key":{"id":{"S":"1234567"}},
  "Expected":{"id":{"Exists":true,"Value":{"S":"1234567"}}},
  "AttributeUpdates":{"name":{"Action":"DELETE"}}
})

Note that AttributeUpdates no longer has any Value property in it.

Was this change intentional? I didn't see anything in the release notes to indicate that it was. I'm perfectly happy to be told that I've been doing it wrong all along, and the old SDK versions were simply letting me get away with it. However, a more informative error message would have saved me some headache.

Thanks!

@lsegal
Copy link
Contributor

lsegal commented Feb 5, 2014

This does look like a regression. Thanks for pointing this out. In the meantime you can pass paramValidation: false to your global AWS.config or service configuration to workaround this error.

@mlogan
Copy link
Author

mlogan commented Feb 5, 2014

It was a one-line fix to my dynamodb code to omit the Value parameter instead of setting it to null, so this is no big deal for me. The new code also works with older API versions.

lsegal added a commit that referenced this issue Feb 6, 2014
This commit fixes an issue where null inputs would cause parameter
validation to fail. This change also makes the SDK ignore null inputs
when serializing, if parameter validation is disabled.

Fixes #225, #226
@lsegal lsegal closed this as completed Feb 6, 2014
@lsegal
Copy link
Contributor

lsegal commented Feb 6, 2014

Thanks for reporting, @mlogan. The above fix will be part of the next release. Sorry for the headache!

lsegal added a commit that referenced this issue Mar 26, 2014
lsegal added a commit that referenced this issue Apr 24, 2014
@lock
Copy link

lock bot commented Sep 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants