|
@@ -144,7 +144,7 @@ discard block |
|
|
block discarded – undo |
144
|
144
|
* |
145
|
145
|
* @return string |
146
|
146
|
*/ |
147
|
|
- private function getDefinitionParameterSchema(\ArrayObject &$definitions, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $operationName) : string |
|
147
|
+ private function getDefinitionParameterSchema(\ArrayObject & $definitions, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $operationName) : string |
148
|
148
|
{ |
149
|
149
|
$parameterSerializerContext = $collection ? $resourceMetadata->getCollectionOperationAttribute($operationName, 'normalization_context', null, true) : $resourceMetadata->getItemOperationAttribute($operationName, 'normalization_context', null, true); |
150
|
150
|
$parameterDefinition = $this->getDefinitionSchema($resourceClass, $resourceMetadata, $parameterSerializerContext); |
|
@@ -167,7 +167,7 @@ discard block |
|
|
block discarded – undo |
167
|
167
|
* |
168
|
168
|
* @return \ArrayObject|null |
169
|
169
|
*/ |
170
|
|
- public function getPathOperationByMethod(string $method, \ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject &$definitions) |
|
170
|
+ public function getPathOperationByMethod(string $method, \ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject & $definitions) |
171
|
171
|
{ |
172
|
172
|
if ('GET' === $method) { |
173
|
173
|
return $this->getPathOperationByMethodGet($pathOperation, $mimeTypes, $collection, $resourceMetadata, $resourceClass, $resourceShortName, $operationName, $definitions); |
|
@@ -222,7 +222,7 @@ discard block |
|
|
block discarded – undo |
222
|
222
|
* |
223
|
223
|
* @return string |
224
|
224
|
*/ |
225
|
|
- private function getDefinitionResponseSchema(\ArrayObject &$definitions, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $operationName) : string |
|
225
|
+ private function getDefinitionResponseSchema(\ArrayObject & $definitions, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $operationName) : string |
226
|
226
|
{ |
227
|
227
|
$responseSerializerContext = $collection ? $resourceMetadata->getCollectionOperationAttribute($operationName, 'denormalization_context', null, true) : $resourceMetadata->getItemOperationAttribute($operationName, 'denormalization_context', null, true); |
228
|
228
|
$responseDefinition = $this->getDefinitionSchema($resourceClass, $resourceMetadata, $responseSerializerContext); |
|
@@ -244,7 +244,7 @@ discard block |
|
|
block discarded – undo |
244
|
244
|
* |
245
|
245
|
* @return \ArrayObject |
246
|
246
|
*/ |
247
|
|
- private function getPathOperationByMethodPut(\ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject &$definitions) |
|
247
|
+ private function getPathOperationByMethodPut(\ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject & $definitions) |
248
|
248
|
{ |
249
|
249
|
|
250
|
250
|
$pathOperation['consumes'] ?? $pathOperation['consumes'] = $mimeTypes; |
|
@@ -288,7 +288,7 @@ discard block |
|
|
block discarded – undo |
288
|
288
|
* |
289
|
289
|
* @return \ArrayObject |
290
|
290
|
*/ |
291
|
|
- private function getPathOperationByMethodPost(\ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject &$definitions) |
|
291
|
+ private function getPathOperationByMethodPost(\ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject & $definitions) |
292
|
292
|
{ |
293
|
293
|
$pathOperation['consumes'] ?? $pathOperation['consumes'] = $mimeTypes; |
294
|
294
|
$pathOperation['produces'] ?? $pathOperation['produces'] = $mimeTypes; |
|
@@ -323,7 +323,7 @@ discard block |
|
|
block discarded – undo |
323
|
323
|
* |
324
|
324
|
* @return \ArrayObject |
325
|
325
|
*/ |
326
|
|
- private function getPathOperationByMethodGet(\ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject &$definitions) |
|
326
|
+ private function getPathOperationByMethodGet(\ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject & $definitions) |
327
|
327
|
{ |
328
|
328
|
$responseDefinitionKey = $this->getDefinitionResponseSchema($definitions, $collection, $resourceMetadata, $resourceClass, $operationName); |
329
|
329
|
|
|
@@ -422,8 +422,7 @@ discard block |
|
|
block discarded – undo |
422
|
422
|
$valueType = $type->isCollection() ? $type->getCollectionValueType() : $type; |
423
|
423
|
|
424
|
424
|
switch ($valueType ? $valueType->getBuiltinType() : null) { |
425
|
|
- case Type::BUILTIN_TYPE_STRING: |
426
|
|
- $valueSchema['type'] = 'string'; |
|
425
|
+ case Type::BUILTIN_TYPE_STRING : $valueSchema['type'] = 'string'; |
427
|
426
|
break; |
428
|
427
|
|
429
|
428
|
case Type::BUILTIN_TYPE_INT: |