Fix attribute writer and reader

This commit fixes several bugs in attribute Json de/serializers.
* Handle voidItem and voidItemDefinition
* Set number of groups in GroupItem
* Refactor the logic of jsonResource
* Fix a Json serialization and deserialization test
Status Job ID Name Coverage
  External
passed ghostflow-branch-check-master