src/Swagger/Serializer/DocumentationNormalizer.php
private function getFiltersParameters(bool $v3, string $resourceClass, string $operationName, ResourceMetadata $resourceMetadata, \ArrayObject $definitions, array $serializerContext = null): array
    {
        if (null === $this->filterLocator) {
            return [];
        }

        $parameters = [];
        $resourceFilters = $resourceMetadata->getCollectionOperationAttribute($operationName, 'filters', [], true);
        foreach ($resourceFilters as $filterId) {
            if (!$filter = $this->getFilter($filterId)) {
                continue;
            }

            foreach ($filter->getDescription($resourceClass) as $name => $data) {
                $parameter = [
                    'name' => $name,
                    'in' => 'query',
                    'required' => $data['required'],
                ];

                $type = $this->getType($v3, $data['type'], $data['is_collection'] ?? false, null, null, $definitions, $serializerContext);
                $v3 ? $parameter['schema'] = $type : $parameter += $type;

                if ('array' === $type['type'] ?? '') {
                    $deepObject = \in_array($data['type'], [Type::BUILTIN_TYPE_ARRAY, Type::BUILTIN_TYPE_OBJECT], true);

                    if ($v3) {
                        $parameter['style'] = $deepObject ? 'deepObject' : 'form';
                        $parameter['explode'] = true;
                    } else {
                        $parameter['collectionFormat'] = $deepObject ? 'csv' : 'multi';
                    }
                }

                $key = $v3 ? 'openapi' : 'swagger';
                if (isset($data[$key])) {
                    $parameter = $data[$key] + $parameter;
                }

                $parameters[] = $parameter;
            }
        }

        return $parameters;
    }
private function getFiltersParameters(bool $v3, string $resourceClass, string $operationName, ResourceMetadata $resourceMetadata, \ArrayObject $definitions, array $serializerContext = null): array
    {
        if (null === $this->filterLocator) {
            return [];
        }

        $parameters = [];
        $resourceFilters = $resourceMetadata->getCollectionOperationAttribute($operationName, 'filters', [], true);
        foreach ($resourceFilters as $filterId) {
            if (!$filter = $this->getFilter($filterId)) {
                continue;
            }

            foreach ($filter->getDescription($resourceClass) as $name => $data) {
                $parameter = [
                    'name' => $name,
                    'in' => 'query',
                    'required' => $data['required'],
                ];

                $type = $this->getType($v3, $data['type'], $data['is_collection'] ?? false, null, null, $definitions, $serializerContext);
                $v3 ? $parameter['schema'] = $type : $parameter += $type;

                if ('array' === $type['type'] ?? '') {
                    $deepObject = \in_array($data['type'], [Type::BUILTIN_TYPE_ARRAY, Type::BUILTIN_TYPE_OBJECT], true);

                    if ($v3) {
                        $parameter['style'] = $deepObject ? 'deepObject' : 'form';
                        $parameter['explode'] = true;
                    } else {
                        $parameter['collectionFormat'] = $deepObject ? 'csv' : 'multi';
                    }
                }

                $key = $v3 ? 'openapi' : 'swagger';
                if (isset($data[$key])) {
                    $parameter = $data[$key] + $parameter;
                }

                $parameters[] = $parameter;
            }
        }

        return $parameters;
    }
private function getFiltersParameters ( bool $ v3 , string $ resourceClass , string $ operationName , ResourceMetadata $ resourceMetadata , \ ArrayObject $ definitions , array $ serializerContext = null ) : array { if ( null === $ this -> filterLocator ) { return [ ] ; } $ parameters = [ ] ; $ resourceFilters = $ resourceMetadata -> getCollectionOperationAttribute ( $ operationName , 'filters' , [ ] , true ) ; foreach ( $ resourceFilters as $ filterId ) { if ( ! $ filter = $ this -> getFilter ( $ filterId ) ) { continue ; } foreach ( $ filter -> getDescription ( $ resourceClass ) as $ name => $ data ) { $ parameter = [ 'name' => $ name , 'in' => 'query' , 'required' => $ data [ 'required' ] , ] ; $ type = $ this -> getType ( $ v3 , $ data [ 'type' ] , $ data [ 'is_collection' ] ?? false , null , null , $ definitions , $ serializerContext ) ; $ v3 ? $ parameter [ 'schema' ] = $ type : $ parameter += $ type ; if ( 'array' === $ type [ 'type' ] ?? '' ) { $ deepObject = \ in_array ( $ data [ 'type' ] , [ Type :: BUILTIN_TYPE_ARRAY , Type :: BUILTIN_TYPE_OBJECT ] , true ) ; if ( $ v3 ) { $ parameter [ 'style' ] = $ deepObject ? 'deepObject' : 'form' ; $ parameter [ 'explode' ] = true ; } else { $ parameter [ 'collectionFormat' ] = $ deepObject ? 'csv' : 'multi' ; } } $ key = $ v3 ? 'openapi' : 'swagger' ; if ( isset ( $ data [ $ key ] ) ) { $ parameter = $ data [ $ key ] + $ parameter ; } $ parameters [ ] = $ parameter ; } } return $ parameters ; }
Gets parameters corresponding to enabled filters.
Gets parameters corresponding to enabled filters .