short answer use the JSON_ON_NULL_CLAUSE
See the documentation at
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/JSON_OBJECT.html
SELECT JSON_OBJECT('test' VALUE null ABSENT ON NULL) from dual ;
Will give you {}
The other option is NULL ON NULL which is the default and will give you
{"test":null}