-
-
Notifications
You must be signed in to change notification settings - Fork 956
Closed
Description
This maybe related to the serializer, but I'm a bit unsure so I'm asking this question here. Let's say I have an entity Book:
/**
* @ApiResource()
*/
class Book
{
/**
* @Groups({"read", "write"})
*/
public $name;
/**
* @Groups("write")
*/
public $author;
/**
* This property has no groups
*/
public $foo;
// ...
}
What I'm trying to achieve now is to serialize the $foo property, regardless of the current context groups. Is there some way to configure some kind of "default group" for properties where no group was given?
I know I could just add the group to my property, but I was hoping to configure something (or decorate something) so the serializer will return the property $foo.
TLDR: How can I define a default group for all properties?
Metadata
Metadata
Assignees
Labels
No labels