How to create Dict from Collection Property in Blender python?
If you don't need to write out default value, just use items() like dictionary.
Unless you assign it, Blender will not create an entry for them.
import bpy
import json

data = [
    prop.items()
    for prop in bpy.context.scene.favit
]

print(json.dumps(data))  # save this string to json file


output:
[[[&quot;index&quot;, 1], [&quot;label&quot;, &quot;hello world&quot;]], [[&quot;label&quot;, &quot;cool world&quot;]]]

The output format is same as [key, value] in a list,
once you want to write back to blender,
json_string = '''[[[&quot;index&quot;, 1], [&quot;label&quot;, &quot;hello world&quot;]], [[&quot;label&quot;, &quot;cool world&quot;]]]'''
data = json.loads(json_string)
for prop_list in data:
    prop = bpy.context.scene.favit.add()
    for key, value in prop_list:
        prop[key] = value