@@ -112,7 +112,11 @@ private function parseResource(ResourceMetadata $resourceMetadata, string $resou
112
112
}
113
113
114
114
if (isset ($ attributes ['denormalization_context ' ]['groups ' ])) {
115
- $ options ['serializer_groups ' ] = isset ($ options ['serializer_groups ' ]) ? array_merge ($ options ['serializer_groups ' ], $ attributes ['denormalization_context ' ]['groups ' ]) : $ options ['serializer_groups ' ];
115
+ if (isset ($ options ['serializer_groups ' ])) {
116
+ $ options ['serializer_groups ' ] += $ attributes ['denormalization_context ' ]['groups ' ];
117
+ } else {
118
+ $ options ['serializer_groups ' ] = $ attributes ['denormalization_context ' ]['groups ' ];
119
+ }
116
120
}
117
121
118
122
return $ this ->getPropertyMetadata ($ resourceMetadata , $ resourceClass , $ io , $ visited , $ options );
@@ -129,8 +133,8 @@ private function parseResource(ResourceMetadata $resourceMetadata, string $resou
129
133
private function getGroupsForItemAndCollectionOperation (ResourceMetadata $ resourceMetadata , string $ operationName ) : array
130
134
{
131
135
$ operation = [
132
- 'denormalization_context ' => array_merge ( $ resourceMetadata ->getItemOperationAttribute ($ operationName , 'denormalization_context ' , []), $ resourceMetadata ->getCollectionOperationAttribute ($ operationName , 'denormalization_context ' , []) ),
133
- 'normalization_context ' => array_merge ( $ resourceMetadata ->getItemOperationAttribute ($ operationName , 'normalization_context ' , []), $ resourceMetadata ->getCollectionOperationAttribute ($ operationName , 'normalization_context ' , []) ),
136
+ 'denormalization_context ' => $ resourceMetadata ->getItemOperationAttribute ($ operationName , 'denormalization_context ' , []) + $ resourceMetadata ->getCollectionOperationAttribute ($ operationName , 'denormalization_context ' , []),
137
+ 'normalization_context ' => $ resourceMetadata ->getItemOperationAttribute ($ operationName , 'normalization_context ' , []) + $ resourceMetadata ->getCollectionOperationAttribute ($ operationName , 'normalization_context ' , []),
134
138
];
135
139
136
140
$ options = [
0 commit comments