diff --git a/app/src/Entity/Tag.php b/app/src/Entity/Tag.php index a06bcefd8..8be8507fe 100644 --- a/app/src/Entity/Tag.php +++ b/app/src/Entity/Tag.php @@ -24,6 +24,7 @@ 'path_label' => 'User tags', ] )] +#[Serializer\ExclusionPolicy('all')] class Tag implements \Stringable, TranslatableInterface { use TranslatableTrait; @@ -32,6 +33,7 @@ class Tag implements \Stringable, TranslatableInterface ORM\GeneratedValue, ORM\Column(name: 'id', type: 'bigint') ] + #[Serializer\Expose] private ?int $id = null; #[ORM\Column(unique: true)] @@ -39,9 +41,11 @@ class Tag implements \Stringable, TranslatableInterface Assert\NotNull, Assert\Length(min: 3, max: 255) ] + #[Serializer\Expose] private ?string $name = null; #[ORM\Column(name: 'active', type: 'boolean', options: ['default' => 1])] + #[Serializer\Expose] private bool $active = true; public function getId(): ?int diff --git a/tests/Controller/fixtures/api-doc-scope-all.json b/tests/Controller/fixtures/api-doc-scope-all.json index 89d9d8308..f01a1665d 100644 --- a/tests/Controller/fixtures/api-doc-scope-all.json +++ b/tests/Controller/fixtures/api-doc-scope-all.json @@ -1029,7 +1029,7 @@ }, "Tag": { "required": [ - "label" + "name" ], "type": "object", "properties": { @@ -1040,7 +1040,7 @@ "format": "int32", "type": "integer" }, - "label": { + "name": { "maxLength": 255, "minLength": 3, "type": "string" diff --git a/tests/Controller/fixtures/api-doc-scope-tag.json b/tests/Controller/fixtures/api-doc-scope-tag.json index a8285e63c..11889cbcc 100644 --- a/tests/Controller/fixtures/api-doc-scope-tag.json +++ b/tests/Controller/fixtures/api-doc-scope-tag.json @@ -321,7 +321,7 @@ }, "Tag": { "required": [ - "label" + "name" ], "type": "object", "properties": { @@ -332,7 +332,7 @@ "format": "int32", "type": "integer" }, - "label": { + "name": { "maxLength": 255, "minLength": 3, "type": "string"