improve json/xml output when params contain a single variable

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | -
| Tests pass?   | -
| Fixed tickets | -
| License       | MIT
| Doc PR        | -