Search notes:

Oracle: JSON_SERIALIZE

PRETTY

PRETTY formats the result for human readability.
select
   json_serialize(
      json_array (
         json_object('id' value 1 ,'item' value 'foo' ,'pit' value sysdate + dbms_random.value*100),
         json_object('id' value 2 ,'item' value 'bar' ,'pit' value sysdate + dbms_random.value*100),
         json_object('id' value 3 ,'item' value 'baz' ,'pit' value sysdate + dbms_random.value*100)
      )
      pretty
   )
from
   dual;

-- [
--   {
--     "id" : 1,
--     "item" : "foo",
--     "pit" : "2021-10-13T20:01:18"
--   },
--   {
--     "id" : 2,
--     "item" : "bar",
--     "pit" : "2021-11-09T06:17:21"
--   },
--   {
--     "id" : 3,
--     "item" : "baz",
--     "pit" : "2021-10-30T20:47:02"
--   }
-- ]

See also

Oracle SQL/JSON

Index