api-platform / api-platform/core

Mercure normalization context per topic

Open
#4,326 11 comments 2 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
2.6k
Forks
980
Avg merge
2d 4h
Merged PRs (30d)
49

Description

**Description**
I think it could be useful support to provide normalization context (or also other options) for mercure per topic. For example if the resource has an additional serialization groups for admin user but the resource update should still be dispatched to admin and simple user currently the hidden information would be dispatched to the simple user or otherwise admin would not receive private information.

**Example**
Maybe something like:
```
#[ApiResource(
mercure: [
'topics' => [
['topic' => '/book/1', 'private' => true, 'normalization_context' => ['read', 'read_admin']],
['topic' => '/book/1', 'private' => false, 'normalization_context' => ['read']],
]
]
)]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.