api-platform / api-platform/core
Set Serialization Groups Manually [feature]
オープン
- 主要言語
- PHP
- スター
- 2.6k
- フォーク
- 980
- 平均マージ
- 2日 5時間
- マージ済み PR(30日)
- 48
説明
**Description**
Make it possible to define the serialization group through the request attributes.
Something like this:
**Example**
https://github.com/api-platform/core/blob/22ce6399180f9408f19b0b3c857317d2ddd7ea9d/src/Serializer/SerializerContextBuilder.php#L60
```php
$context = $resourceMetadata->getTypedOperationAttribute($operationType, $attributes[$operationKey], $key, [], true);
if ($context and $context['groups']) {
$serializerContext = $request->attributes->get('_api_serializer_context', []);
$context = array_merge_recursive($context, $serializerContext);
}
```
コントリビューションガイド
評価
この issue はまだ評価されていません。