JQ can be used to create JSON objects of a certain shape, with the help of a few command line options.
You can use --argjson to load JSON objects into variables that can then be referenced by $name. …
--argjson
$name