Saasli / saasli-backend

Documentation
https://saasli.github.io/docs/
0 stars 0 forks source link

[Postgres Poller] Support Decimal (Currency) fields #62

Closed godd9170 closed 7 years ago

godd9170 commented 7 years ago

As it stands, the following error is thrown should a Decimal need to be serialized.

"errorType": "TypeError",
  "errorMessage": "Decimal('1.05') is not JSON serializable"

The following must be incorporated in order to ensure Decimals can be polled. http://stackoverflow.com/questions/31202956/json-typeerror-decimal34-3-is-not-json-serializable

godd9170 commented 7 years ago

Looks like both string representations, as well as unquoted 'decimal' representations work on the objects endpoint. So we'll just make the Postgres Poller stringify to avoid serialization troubles.