We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I set groups in the exclusion strategy of a relation, the embedded is never generated.
/** * @Hateoas\Relation( * "user", * href = "expr('/api/user/' ~ object.getUser().getId())", * embedded = "expr(object.getUser())", * exclusion = @Hateoas\Exclusion( * excludeIf = "expr(object.getUser() === null)", * groups={"travel"} * ) * ) */
It's because the ExclusionManager call the shouldSkipProperty method of JMS's GroupsExclusionStrategy with the embedded exclusion. In that case, the exclusion of embedded is empty, so these tests fail, so this relation is not embedded.
ExclusionManager
shouldSkipProperty
GroupsExclusionStrategy
The only way to make it working is to repeat the exclusion on the embedded:
/** * @Hateoas\Relation( * "user", * href = "expr('/api/user/' ~ object.getUser().getId())", * embedded = @Hateoas\Embedded( * "expr(object.getUser())", * exclusion = @Hateoas\Exclusion( * groups={"travel"} * ) * ), * exclusion = @Hateoas\Exclusion( * excludeIf = "expr(object.getUser() === null)", * groups={"travel"} * ) * ) */
That's why I think that embedded should inherit from relation exclusion when there's no specified on it.
The text was updated successfully, but these errors were encountered:
This simply fixes willdurand#164
9060b10
This makes sense
Sorry, something went wrong.
49082ed
Merge pull request #166 from adrienbrault/gh-164
f67d03c
Fix #164
No branches or pull requests
When I set groups in the exclusion strategy of a relation, the embedded is never generated.
It's because the
ExclusionManager
call theshouldSkipProperty
method of JMS'sGroupsExclusionStrategy
with the embedded exclusion. In that case, the exclusion of embedded is empty, so these tests fail, so this relation is not embedded.The only way to make it working is to repeat the exclusion on the embedded:
That's why I think that embedded should inherit from relation exclusion when there's no specified on it.
The text was updated successfully, but these errors were encountered: