Revert "Revert "NXP-10146: don't serialize widgets array if empty""

This reverts commit c950e41fdaec6f1aaffab471d96a46b180a06abd.