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