Closed
Description
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? Is this already possible or might be a new feature?