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'}]

3
  • 1
    Does this answer your question? Object of type 'Decimal' is not JSON serializable Commented Apr 27, 2021 at 14:10
  • @JonSG No It does not work. Commented Apr 27, 2021 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? Commented Apr 27, 2021 at 14:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.