obj = {'layer1': {'layer2': {'layer3_1': NoIndent([{'y': 7, 'x': 1}, {'y': 
    4, 'x': 0}, {'y': 3, 'x': 5}, {'y': 9, 'x': 6}]), 'layer3_2': 'string'}}}
print(json.dumps(obj, indent=2, sort_keys=True, cls=NoIndentEncoder))
Can I implement custom indentation for pretty-printing in Python’s JSON module?