toJson and ifEmptySetNull