api-platform / api-platform/admin
Using serialization group for LIST, but not for SHOW results in empty columns instead of non existent columns
- Dominant language
- TypeScript
- Stars
- 516
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
When I'm using serialization groups for `collectionOperations/get`, I'm expecting those fields not to appear in the view, instead I'm getting this fields with empty values.
Screenshot should illustrate the issue, empty columns are not really empty, but filtered with serialization group.

my resource configuration
```yaml
App\Entity\Restaurant:
collectionOperations:
get:
filters: ['restaurant.search_filter']
normalization_context:
groups: ['restaurant:list']
denormalization_context:
groups: ['restaurant:list']
post: ~
attributes:
normalization_context:
groups: ['restaurant']
denormalization_context:
groups: ['restaurant']
```
Serialization configuration
```yaml
App\Entity\Restaurant:
attributes:
owner:
groups: ['restaurant', 'restaurant:list']
city:
groups: ['restaurant', 'restaurant:list']
specialities:
groups: ['restaurant']
...
name:
groups: ['restaurant']
...
```
If I will change entity global `normalization_context` to `restaurant:list`, then I will get only owner and city everywhere and it's not possible to extend list of fields per operation with `restaurant` group.
Is it bug or misconfiguration? What can be done to render only specific fields at resources listing page?
Contributor guide
Assessment
This issue has not been assessed yet.