Skip to content

Accept numbers serialized as strings#10

Open
malcolmgreaves wants to merge 5 commits intomainfrom
mg/deserialize_str_encode_numbers
Open

Accept numbers serialized as strings#10
malcolmgreaves wants to merge 5 commits intomainfrom
mg/deserialize_str_encode_numbers

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