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

Enable customizing date and data property encoding #8443

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Conversation

tgoyne
Copy link
Member

@tgoyne tgoyne commented Dec 20, 2023

We were unintentionally bypassing the encoder when converting properties to strings, which broke things like JSONEncoder.dateEncodingStrategy.

I also added tests for some other Codable things which we weren't testing, such as nested objects and keyEncodingStrategy. Using encoder.outputFormatting = [.sortedKeys] makes the resulting json consistent between platforms, which lets us check that we got exactly the input string after round-tripping through a Realm object.

Fixes #8425.

@tgoyne tgoyne self-assigned this Dec 20, 2023
We were unintentionally bypassing the encoder when converting properties to
strings, which broke things like JSONEncoder.dateEncodingStrategy.
@tgoyne tgoyne merged commit 7411344 into master Jan 9, 2024
123 of 127 checks passed
@tgoyne tgoyne deleted the tg/date-codeable branch January 9, 2024 17:48
dianaafanador3 pushed a commit that referenced this pull request Jan 18, 2024
We were unintentionally bypassing the encoder when converting properties to
strings, which broke things like JSONEncoder.dateEncodingStrategy.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants