As discussed recently, here is an undocumented patch for json_strip_nulls and jsonb_strip_nulls. cheers andrew
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных