-
Notifications
You must be signed in to change notification settings - Fork 603
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
Provide support to serialize dates in util-dynamodb #1534
Comments
If we go ahead with using We still need to discuss adding |
I like the idea of ISO 8601 by default, especially considering nobody wants the current default behavior of serializing to convertDateToNumber, just like convertEmptyValues, seems like a trap to me, as it could be a slippery slope:
Hence I prefer letting consumers inject their own serialization preferences - nothing is stopping them from re-using and composing their rules as they see fit |
Update: we're exploring serialization of Date objects using premarshalling #1533 (comment) |
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. |
Is your feature request related to a problem? Please describe.
util-dynamodb currently throws error when date is passed.
Refs: #1531
Describe the solution you'd like
The problem is with JSON spec itself: there is no literal syntax for dates in JSON.
JSON spec: https://www.ietf.org/rfc/rfc4627.txt
Possible solution #1: Convert dates to ISO 8601 strings by default. Provide an option (say
convertDateToNumber
) which converts date to a string value. This option can be passed along withconvertEmptyValues
Possible solution #2: Expose pre-marshall configuration allowing users to send their own convert functions, detailed in #1533
Describe alternatives you've considered
Converting dates to String/Number or a different format before passing it to the converter.
Additional context
This request was raised in PR #1531 (comment)
The text was updated successfully, but these errors were encountered: