Hi ChunLing,
Thanks for your report, I can reproduce it, With OMIT
QUOTES, json_populate_type() turns arrays and objects into text too.
The attached patch only strips quotes when the jsonb value is a
scalar, so arrays and objects take the same path as KEEP QUOTES.
Thanks,
Shihao