-
-
Notifications
You must be signed in to change notification settings - Fork 909
(de)normalization_context is not used for subresourceOperations #1616
New issue
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
Comments
Mhh, I think that it's taking the "normalization_context" of the required resource class, not the class where the actual subresource is declared. I'll comment in the PR. When I implemented subresources at first, there was no Btw there is no "denormalization" on subresources yet. |
Yes, I noticed that. But there are no way to that in a clean way. If I add a new collectionOperationType, It adds a new route :/ IMHO, this way is much more easier and intuitive. |
Hi, |
I opened a pr for that too :-D |
This is not exacly the same issue but is very close. I tried to use /**
* @ORM\Entity(repositoryClass="App\Repository\ArticleRepository")
* @ApiResource(
* attributes={"denormalization_context"={"allow_extra_attributes"=false}}
* collectionOperations={
* "get",
* "post"={"denormalization_context"={"groups"={"post"}}}
* },
* itemOperations={
* "get",
* "put"={"denormalization_context"={"groups"={"put"}, "allow_extra_attributes"=false}}
* }
* )
*/
class Article {} The fun part is the group I specified on "PUT" is ok, but the "allow_extra_attributes" context key is ignored. |
Closing in favor of #2706 |
Uh oh!
There was an error while loading. Please reload this page.
According to the example in the doc, the following snippet do not work:
Reprocuder: https://github.com/lyrixx/test/tree/api-platform-subresource-path
The text was updated successfully, but these errors were encountered: