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

addPaths() private method

Updates the list of entries in the paths collection.
private addPaths ( ArrayObject $paths, ArrayObject $definitions, string $resourceClass, string $resourceShortName, ResourceMetadata $resourceMetadata, array $mimeTypes, boolean $collection )
$paths ArrayObject
$definitions ArrayObject
$resourceClass string
$resourceShortName string
$resourceMetadata ApiPlatform\Core\Metadata\Resource\ResourceMetadata
$mimeTypes array
$collection boolean
    private function addPaths(\ArrayObject $paths, \ArrayObject $definitions, string $resourceClass, string $resourceShortName, ResourceMetadata $resourceMetadata, array $mimeTypes, bool $collection)
    {
        if (null === ($operations = $collection ? $resourceMetadata->getCollectionOperations() : $resourceMetadata->getItemOperations())) {
            return;
        }
        foreach ($operations as $operationName => $operation) {
            $path = $this->getPath($resourceShortName, $operation, $collection);
            $method = $collection ? $this->operationMethodResolver->getCollectionOperationMethod($resourceClass, $operationName) : $this->operationMethodResolver->getItemOperationMethod($resourceClass, $operationName);
            $paths[$path][strtolower($method)] = $this->getPathOperation($operationName, $operation, $method, $collection, $resourceClass, $resourceMetadata, $mimeTypes, $definitions);
        }
    }