Python - fix enumeration for json objects