ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer::updatePostOperation PHP Method

updatePostOperation() private method

private updatePostOperation ( ArrayObject $pathOperation, array $mimeTypes, boolean $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, ArrayObject $definitions ) : ArrayObject
$pathOperation ArrayObject
$mimeTypes array
$collection boolean
$resourceMetadata ApiPlatform\Core\Metadata\Resource\ResourceMetadata
$resourceClass string
$resourceShortName string
$operationName string
$definitions ArrayObject
return ArrayObject
    private function updatePostOperation(\ArrayObject $pathOperation, array $mimeTypes, bool $collection, ResourceMetadata $resourceMetadata, string $resourceClass, string $resourceShortName, string $operationName, \ArrayObject $definitions)
    {
        $pathOperation['consumes'] ?? ($pathOperation['consumes'] = $mimeTypes);
        $pathOperation['produces'] ?? ($pathOperation['produces'] = $mimeTypes);
        $pathOperation['summary'] ?? ($pathOperation['summary'] = sprintf('Creates a %s resource.', $resourceShortName));
        $pathOperation['parameters'] ?? ($pathOperation['parameters'] = [['name' => lcfirst($resourceShortName), 'in' => 'body', 'description' => sprintf('The new %s resource', $resourceShortName), 'schema' => ['$ref' => sprintf('#/definitions/%s', $this->getDefinition($definitions, $collection, true, $resourceMetadata, $resourceClass, $operationName))]]]);
        $pathOperation['responses'] ?? ($pathOperation['responses'] = ['201' => ['description' => sprintf('%s resource created', $resourceShortName), 'schema' => ['$ref' => sprintf('#/definitions/%s', $this->getDefinition($definitions, $collection, false, $resourceMetadata, $resourceClass, $operationName))]], '400' => ['description' => 'Invalid input'], '404' => ['description' => 'Resource not found']]);
        return $pathOperation;
    }