fix(api): serialize TemporalDateTime in identifier for ModelQueries.get - #7237
Closed
VarshithaPamisetty wants to merge 2 commits into
Closed
Conversation
The get-by-ID path passed identifier values straight through without running them through _getSerializedValue (which the list/filter path uses), so a TemporalDateTime in a custom identifier was never stringified before JSON-encoding, throwing JsonUnsupportedObjectError. Serialize identifier values for both the get variables and the composite-key document. Adds a CpkTemporalPrimaryKey test model + regression test, and the matching model in the api-multi-auth gen2 backend.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7237 +/- ##
=======================================
Coverage 40.97% 40.97%
=======================================
Files 121 121
Lines 8273 8273
Branches 3598 3598
=======================================
Hits 3390 3390
Misses 4883 4883 🚀 New features to boost your workflow:
|
cadivus
reviewed
Aug 10, 2026
| // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously |
Member
There was a problem hiding this comment.
Just ignoring all of this is not ideal. This should be avoided.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ModelQueries.get()throwsJsonUnsupportedObjectErrorwhen an identifier has aTemporalDateTimein it. The get path doesn't run identifier values through_getSerializedValuelike the list/filter path does, so the date never getsstringified before JSON-encoding.
Re: #6298.
getvariables viabuildVariablesForGetRequest.getdocument values too (date comes out quoted).CpkTemporalPrimaryKeytest model + regression test.CpkTemporalPrimaryKeymodel to theapi-multi-authgen2 backend.dart analyzeclean, tests red to green. Draft: live AppSync e2e still pending backend deploy + codegen.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.