Perhaps use an existing JSON command line tool and piping it into Curl?

This. jo (https://github.com/jpmens/jo) solves what this proposal seems to be about.