Skip to content

Commit

Permalink
skip serializing array's when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn1001 committed Jul 5, 2023
1 parent df7d9cb commit 4cd051f
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Entity/AccessPolicyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class AccessPolicyCollection
* @Serializer\Type("array<SandwaveIo\Acronis\Entity\AccessPolicy>")
* @Serializer\SerializedName("items")
* @Serializer\Groups({"update_data"})
* @Serializer\SkipWhenEmpty()
*/
private array $items = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/ApplicationUuidCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ApplicationUuidCollection
*
* @Serializer\Type("array<string>")
* @Serializer\SerializedName("items")
* @Serializer\SkipWhenEmpty()
*/
private array $items = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Contact
* @Serializer\SerializedName("types")
* @Serializer\Type("array<string>")
* @Serializer\Groups({"create_data","update_data"})
* @Serializer\SkipWhenEmpty()
*/
private array $types = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/InfraUuidCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class InfraUuidCollection
*
* @Serializer\Type("array<string>")
* @Serializer\SerializedName("infras")
* @Serializer\SkipWhenEmpty()
*/
private array $items = [];

Expand Down
2 changes: 2 additions & 0 deletions src/Entity/OfferingCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class OfferingCollection
*
* @Serializer\Type("array<SandwaveIo\Acronis\Entity\Offering>")
* @Serializer\SerializedName("items")
* @Serializer\SkipWhenEmpty()
*/
private array $offeringItems = [];

Expand All @@ -29,6 +30,7 @@ class OfferingCollection
* @Serializer\Type("array<SandwaveIo\Acronis\Entity\Offering>")
* @Serializer\SerializedName("offering_items")
* @Serializer\Groups({"update_data"})
* @Serializer\SkipWhenEmpty()
*/
private array $updatedOfferingItems = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/SearchResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class SearchResult
*
* @Serializer\SerializedName("path")
* @Serializer\Type("array<string>")
* @Serializer\SkipWhenEmpty()
*/
private array $path = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/SearchResultCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SearchResultCollection
*
* @Serializer\Type("array<SandwaveIo\Acronis\Entity\SearchResult>")
* @Serializer\SerializedName("items")
* @Serializer\SkipWhenEmpty()
*/
private array $items = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/TenantCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class TenantCollection
*
* @Serializer\Type("array<SandwaveIo\Acronis\Entity\Tenant>")
* @Serializer\SerializedName("items")
* @Serializer\SkipWhenEmpty()
*/
private array $items = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/UsageCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class UsageCollection
*
* @Serializer\Type("array<SandwaveIo\Acronis\Entity\Usage>")
* @Serializer\SerializedName("items")
* @Serializer\SkipWhenEmpty()
*/
private array $items = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/UserCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class UserCollection
*
* @Serializer\Type("array<SandwaveIo\Acronis\Entity\User>")
* @Serializer\SerializedName("items")
* @Serializer\SkipWhenEmpty()
*/
private array $items = [];

Expand Down
1 change: 1 addition & 0 deletions src/Entity/UserUuidCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class UserUuidCollection
*
* @Serializer\Type("array<string>")
* @Serializer\SerializedName("items")
* @Serializer\SkipWhenEmpty()
*/
private array $items = [];

Expand Down

0 comments on commit 4cd051f

Please sign in to comment.