tcalmant / jsonrpclib

A Python (2 & 3) JSON-RPC over HTTP that mirrors the syntax of xmlrpclib (aka jsonrpclib-pelix)
https://jsonrpclib-pelix.readthedocs.io/
Apache License 2.0
53 stars 24 forks source link

Bug fix: add handling of decimal.Decimal value to jsonclass.py #60

Closed pourhouse closed 3 months ago

pourhouse commented 4 months ago

The dump() method in jsonclass was emitting a list with "decimal.Decimal" - the correct module and class name, but no value to be used in deserialization was included. The net effect was all Decimal's being transported came through with the default value of 0.

This pull requests fixes this by including the string representation of the Decimal to be used by load() on deserialization.

A test case is included.

tcalmant commented 4 months ago

Hi, sorry for the delay. I'll try to find some time this week to test & merge.