Skip to content

Commit e84c399

Browse files
committed
Correct subresource operations documentation
1 parent afae479 commit e84c399

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/operations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class Answer
297297
{
298298
return $this->id;
299299
}
300-
300+
301301
// ...
302302
}
303303
```
@@ -341,7 +341,7 @@ class Question
341341
{
342342
return $this->id;
343343
}
344-
344+
345345
// ...
346346
}
347347
```
@@ -376,7 +376,7 @@ If you put the subresource on a relation that is to-many, you will retrieve a co
376376

377377
Last but not least, subresources can be nested, such that `/questions/42/answer/comments` will get the collection of comments for the answer to question 42.
378378

379-
You may want custom groups on subresources. Because a subresource is nothing more than a collection operation, you can set `normalization_context` or `denormalization_context` on that operation. To do so, you need to override `subresourceOperations`. Based on the above operation, because we retrieve an answer, we need to alter its configuration:
379+
You may want custom groups on subresources, you can set `normalization_context` or `denormalization_context` on that operation. To do so, add a `subresourceOperations` node. For example:
380380

381381
```php
382382
<?php
@@ -692,7 +692,7 @@ class Book
692692
* @Groups("publication")
693693
*/
694694
public $isbn;
695-
695+
696696
// ...
697697
}
698698
```

0 commit comments

Comments
 (0)