Hi,
I have a problem with a custom JSON type, which is not preserving keys order, despite that I'm using python 3.8.
Here is the type definition and usage:
```
import json
from sqlalchemy import Column, Integer
from sqlalchemy.types import TypeDecorator, TEXT
from sqlalchemy.ext.mutable import MutableDict
class JSONType(TypeDecorator):
impl = TEXT
def process_bind_param(self, value, dialect):
if value is not None:
value = json.dumps(value)
return value
def process_result_value(self, value, dialect):
if value is not None:
value = json.loads(value)
return value
JSONDict = MutableDict.as_mutable(JSONType)
class Picture(Base):
__tablename__ = 'picture'
id = Column(Integer, primary_key=True)
data = Column(JSONDict)
```
When I'm storing values in the data field (values are nested elements of different types), store the picture in database and reload it, the keys order of data dict is not preserved. I'm don't understand why, because the version of python I'm using is supposed to keep the dict insertion order.
Have you some idea how to solve that ? The JSON keys order is important for my application.
Thank you