Python dictionaries do not maintain order, so you cannot guarantee the order you entered the data is the same order it will be in when emitted from json.dumps(). If you need an ordered dictionary, check out collections.OrderedDict.
1
solved Python JSON union dictionay list