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

Accept numbers serialized as strings #10

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

malcolmgreaves
Copy link
Owner

Updates deserialize to accept numeric values encoded as strings.

This occurs when JSON serialization a dictionary with int or float keys. To handle a dictionary, JSON converts the value into an object. Objects must have string-valued keys, so the numbers are encoded i.e. str(x) for any x that is a dictionary key.

The updated final deserialization case now attempts to perform this specific deserialization route before testing the existing numerical deserialization routes. New test cases are present to check for this new behavior.

@malcolmgreaves malcolmgreaves added the enhancement New feature or request label Jun 10, 2021
@malcolmgreaves malcolmgreaves self-assigned this Jun 10, 2021
@malcolmgreaves malcolmgreaves force-pushed the mg/deserialize_str_encode_numbers branch from 14b120e to ac4379e Compare March 9, 2022 03:15
malcolmgreaves and others added 5 commits March 8, 2022 19:26
Updates `deserialize` to accept numeric values encoded as strings. 

This occurs when JSON serialization a dictionary with `int` or `float` keys. To handle a dictionary, JSON converts the value into an object. Objects must have string-valued keys, so the numbers are encoded i.e. `str(x)` for any `x` that is a dictionary key.

The updated final deserialization case now attempts to perform this specific deserialization route before testing the existing numerical deserialization routes. New test cases are present to check for this new behavior.
@malcolmgreaves malcolmgreaves force-pushed the mg/deserialize_str_encode_numbers branch from c2cf31c to f57aede Compare March 9, 2022 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant