Hi
'null' - is valid JSON document, but not array or object. It is just JSON-null in JSON. (not NULL in terms RDBMS)
Same as '"test"' - is valid JSON-encoded string 'test', '10' - valid JSON int scalar.
jsonb_array_length accept only JSON array documents: '[1,2,3]', '[null, null]', '[]', '[{"n":1}]' and so on and not
acceptscalars and objects
Regards, Sergej