Skip to content

[V4] Update JSON error unmarshaller not to check for nested properties #3888

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

dscpinheiro
Copy link
Contributor

Fixes #3764

Description

The SDK JSON (aws-restjson1 ) error unmarshaller checks for properties that end in certain values (the original spec is in the sdk-unmarshal-errors SEP). However, customers can request that DynamoDB return values whenever a PUT item fails due to a condition not being met.

If any properties in the customer model (which we don't control) also end with one of those suffixes, our unmarshaller fails. I updated it to only check for the values at the root level of the response.

This PR is for V4 as we have better coverage regarding protocol tests, but let me know if fixing it in V3 makes sense (from what I saw the logic has been in the SDK for quite some time and it's not a regression in V4).

Testing

  • Dry-runs: DRY_RUN-77340fa6-b014-4138-9335-df03b1fad2c0 (.NET) and DRY_RUN-ef8c7677-19a9-4078-ae35-1027e13e061b (PowerShell)
  • Ran the reproduction from the original issue and confirmed ConditionalCheckFailedException was thrown as expected

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

Copy link
Member

@normj normj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the users that reported the issue are still using v3.7 and looks to be a blocking issue for them we should back port the fix to V3.

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

Successfully merging this pull request may close these issues.

DynamoDBv2 throws AmazonClientException when using ReturnValuesOnConditionCheckFailure
2 participants