You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exclusion policy defined in Section should not allow Block's "title" property to render.
Actual:
embedded Block still has its "title" present.
Code:
use Hateoas\Configuration\Annotation as Hateoas;
use JMS\Serializer\Annotation as Serializer;
/**
* @Serializer\ExclusionPolicy("all")
* @Hateoas\Relation("block",
* embedded = @Hateoas\Embedded(
* "expr(object.getBlock())",
* exclusion = @Hateoas\Exclusion(groups="extended" )
* )
* )
*/
class Section
{
public function getBlock(){...}
use Hateoas\Configuration\Annotation as Hateoas;
use JMS\Serializer\Annotation as Serializer;
/**
* @Serializer\ExclusionPolicy("all")
*/
class Block
{
/**
* @Serializer\Groups({"extended"})
* @Serializer\Expose
* @var string
*/
private $title;
...
}
Am I doing something wrong?
I noticed, that the JmsSerializer is not aware of any exclusion strategy for that property so it simply skips the rest of the checks.
I have very similar case, however for me annotations are working but yml mappings are not, to be more precise - exclude, expose, exclusion_policy provided by JMS are not being parsed, but (for example) virtual_properties are working fine.
If i'll use annotation like @jkobus mentioned, everything is working just fine, however i do use yml mapping mostly because of extending vendor models
Expected behaviour:
Actual:
Code:
Am I doing something wrong?
I noticed, that the JmsSerializer is not aware of any exclusion strategy for that property so it simply skips the rest of the checks.
refs #154 #141
The text was updated successfully, but these errors were encountered: