Why not just model the json as objects in (insert favorite language) and then use that code to generate the json?
Quick google shows that others have done things like this already...
[1] https://noise.getoto.net/2021/10/14/using-jsonpath-effective...
[2] https://aws.amazon.com/about-aws/whats-new/2022/01/aws-step-...
[3] https://docs.aws.amazon.com/step-functions/latest/dg/sfn-loc...