Skip to content

Fix Document enumeration for Dictionary types to resolve WebAuthn serialization errors #3838

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 2 commits into
base: aws-sdk-net-v3.7-development
Choose a base branch
from

Conversation

AlexDaines
Copy link
Contributor

@AlexDaines AlexDaines commented May 22, 2025

Description

Fixed a serialization bug in the Document class where the IEnumerator IEnumerable.GetEnumerator() method always attempted to convert Documents to Lists, causing InvalidDocumentTypeConversionException when the Document contained Dictionary structures. Updated the method to handle both Dictionary and List types, matching the pattern already used in the non-generic IEnumerable.GetEnumerator() method.

Motivation and Context

This change fixes a critical issue where WebAuthn operations like StartWebAuthnRegistrationAsync were failing with serialization errors. The WebAuthn service returns response data as Dictionary structures, but the Document enumeration logic was incorrectly assuming all Documents were Lists during JSON serialization.
Fixes #3837

Testing

  • Verified that the fix resolves the WebAuthn StartWebAuthnRegistrationAsync serialization error
  • Confirmed the implementation follows the existing pattern used in the same class for the non-generic IEnumerable.GetEnumerator() method
  • Tested that Dictionary-type Documents can now be properly enumerated during JSON serialization

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • 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

@AlexDaines AlexDaines changed the title Fix Document enumeration to handle Dictionary types in Fix Document enumeration for Dictionary types to resolve WebAuthn serialization errors May 22, 2025
@AlexDaines AlexDaines requested a review from peterrsongg May 22, 2025 16:25
@peterrsongg peterrsongg requested a review from afroz429 May 22, 2025 17:24
@AlexDaines AlexDaines marked this pull request as ready for review May 22, 2025 18:52
@dscpinheiro dscpinheiro added the v3 label May 25, 2025
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.

3 participants