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

[vdk-plugins] vdk-ingest-http: Adopt simplejson in place of json #1229

Merged
merged 2 commits into from
Oct 11, 2022

Conversation

doks5
Copy link
Contributor

@doks5 doks5 commented Oct 10, 2022

The json package from the standard library is vey versatile and provides a lot of functionalities for json encoding and decoding. It, however, has some limitations when handling special python types like decimal.Decimal, which causes TypeErrors to be raised when ingesting payloads that contain such special types.

This change adopts the simplejson package in place of the json package from the standard library. simplejson handles conversion of special types like decimal.Decimal to proper json types without loss of precision, https://simplejson.readthedocs.io/en/latest/#basic-usage

Testing done: Added unit test

Signed-off-by: Andon Andonov andonova@vmware.com

The json package from the standard library is vey versatile and provides a lot
of functionalities for json encoding and decoding. It, however, has some limitations
when handling special python types like decimal.Decimal, which causes TypeErrors to
be raised when ingesting payloads that contain such special types.

This change adopts the simplejson package in place of the json package from the
standard library. simplejson handles conversion of special types like decimal.Decimal
to proper json types without loss of precision, https://simplejson.readthedocs.io/en/latest/#basic-usage

Testing done: Added unit test

Signed-off-by: Andon Andonov <andonova@vmware.com>
@doks5 doks5 self-assigned this Oct 11, 2022
@doks5 doks5 merged commit 5f91922 into main Oct 11, 2022
@doks5 doks5 deleted the person/andonova/json-error branch October 11, 2022 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants