fix 'only generation of JSON objects or arrays' allowed error