Closed morfair closed 9 years ago
.toHash
is guaranteed to return a dictionary, but whether or not it's JSON serializable is not a concern of this library (in fact, there is absolutely no use of json whatsoever in the library). If you'd like to be able to JSON serialize the result, then you should just extend json.JSONEncoder
(as described here) so that it can handle the Decimal
type.
.toHash() function return PostgreSQL numeric() type as Decimal, AutobahnPython can't JSON serialize it.
.toHash() result: { 'longitude': Decimal('41.036283') }
Autobahn error: wamp.error.invalid_payload WAMP serialization error (Decimal('41.036283') is not JSON serializable)