How can I mark root object as null

You don't.

If there are no objects in the list, either omit the field completely or show it as an empty array. Null values only apply to fields that are indexed, which the root object is not. In the example above the fields in the array are indexed as custom_field.pid and custom_field.sharing_type. custom_field is part of the path but not indexed separately, so you can not set a null value for it.