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

Fix decoding of data classes in maps, and denormalizing map keys consistently #444

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

rocketraman
Copy link
Contributor

Resolves #443.

This PR starts from the regression repro created by @osoykan (b256e2e), modifies it to a minimal issue reproduction (4b70665), and then fixes the two related problems (da9706c and 3922914).

osoykan and others added 4 commits August 15, 2024 23:55
When nodes were being denormalized for extracting into maps or hikara
data sources, it was being done recursively. Therefore, nodes further
down the tree were seeing only the denormalized keys.

Make the `denormalize` function non-recursive to fix this issue.

Further, make denormalization more targeted -- rather than a class
which denormalizes all nodes passed to a downstream denormalizer
(`MapDecoder` and `HikaraDataSourceDecoder`) each of these decoders
now denormalizes directly.

This simplifies the code and clarifies intent.
This also fixes some existing unit tests which now have the correct
expected value.
@rocketraman
Copy link
Contributor Author

@sksamuel Sorry, put the comment on the issue instead of the PR... would appreciate a review and merge of this asap, because current master is a bit broken.

@sksamuel sksamuel merged commit 5967b2f into sksamuel:master Sep 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Path normalization breaks decoding data classes inside maps and sets incorrect map keys for property sources
3 participants