Serialization Groups
See original GitHub issueHi there,
Quick question, I’ve tried looking through the documentation (including 2.0) but struggling to find the answer.
I have serialization groups set up on my Entity. This displays the required fields I want to see on my GET
request, however I want to be able to display different fields on a custom GET
Action that I’ve set up.
For example in the case of a Book entity that has a OneToMany to a Review Entity. In my out of the box GET
request I have the serialization groups so that I don’t return any of the Reviews.
But I want to set up a Custom Action with say a route of book/1/reviews
that brings back a few of the Book fields (name, isbn) and all the reviews linked. I know I can setup Groups per method type, but wondered if there was a way of setting a serialization group per GET request (such as one for the standard CRUD method and one for a Custom Action).
Hope that makes sense.
Kind regards Paul
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Thanks @soyuka @teohhanhui
yes, see here