0

How can I solved it? Here is my data structure.

[{'SK': 'A', 'GSI1-SK': 'BG', 'GSI1-PK': 'CTR', 'PK': 'CTR-ec66ca4d-e07d-426c-9e65-7afa7646dbf1', 'Data': {'threeLetterIsoCode': 'BAN', 'defaultVoiceProvider': 'TWILIO', 'activationStatus': 'ACTIVE', 'twoLetterIsoCode': 'BG', 'defaultTimezone': 'Pacific/Honolulu', 'smsUnitPrice': {'currency': 'USD', 'amount': Decimal('2')}, 'contributionCommissionPercent': Decimal('0.5'), 'countryCodes': ['088'], 'defaultLanguage': 'en', 'defaultCurrency': 'USD', 'inboundCallPerMinutePrice': {'currency': 'USD', 'amount': Decimal('3')}, 'imageUrl': 'http://www.ulr.com', 'name': 'Bangladesh', 'createdTime': '2021-04-27T13:31:25.552549', 'missedCallTimeoutInSecs': Decimal('3'), 'contactPhoneNumber': '0173695874', 'defaultPaymentGateway': 'STRIPE', 'didUnitPrice': {'currency': 'USD', 'amount': Decimal('2')}}, 'Type': 'COUNTRY'}]

  • Does this answer your question? [Object of type 'Decimal' is not JSON serializable](https://stackoverflow.com/questions/63278737/object-of-type-decimal-is-not-json-serializable) – JonSG Apr 27 '21 at 14:10
  • @JonSG No It does not work. – Aliul Islam Dipu Apr 27 '21 at 14:26
  • You tried doing `float('2')` rather than `Decimal('2')` and related other spots and you still get this error? If so, did you try using `import simplejson as json` per the answer in that post? – JonSG Apr 27 '21 at 14:44

0 Answers0