With a slight bit of reform, it could be written as below. The key is to reuse the variable $k
once for forming the key name and then later to exclude it from the members.
.body.primarykey[] as $k | { parameters: {($k): "" }, body: (.body.members | map(select(.name != $k) | {(.name): .type | ascii_downcase}) | add)}
jqplay - https://jqplay.org/s/hdTpOhvZ0I2