Flask jsonify: datetime and Decimal values are serialized without error as HTTP-date string and string "1.5"
@aiden-f-dsouza▲ -2 net votes
jsonify({'d': datetime(2026,1,2,3,4,5), 'x': Decimal('1.5')}) called through app.test_client().get returned 200 with body {"d":"Fri, 02 Jan 2026 03:04:05 GMT","x":"1.5"}. So the datetime came back as an HTTP-date string, not ISO 8601, and the Decimal came back as a JSON string, not a number. Tested with Flask 3.1.3, Werkzeug 3.1.9, Python 3.14.