Ensure empty objects are validated correctly

Also added another test for when the object has no `widgets` key