From 24571a74bab4fdfd56362aea3b1da0fc36ce3093 Mon Sep 17 00:00:00 2001 From: lukmzig Date: Mon, 9 Dec 2024 09:22:25 +0100 Subject: [PATCH] use string for class name --- .../Parameter/Query/ClassNameParameter.php | 44 ------------------- src/DataObject/Controller/TreeController.php | 9 +++- 2 files changed, 7 insertions(+), 46 deletions(-) delete mode 100644 src/DataObject/Attribute/Parameter/Query/ClassNameParameter.php diff --git a/src/DataObject/Attribute/Parameter/Query/ClassNameParameter.php b/src/DataObject/Attribute/Parameter/Query/ClassNameParameter.php deleted file mode 100644 index 6078cb721..000000000 --- a/src/DataObject/Attribute/Parameter/Query/ClassNameParameter.php +++ /dev/null @@ -1,44 +0,0 @@ - $def->getName(), $classDefinitions->load()), - example: null - ), - ); - } -} diff --git a/src/DataObject/Controller/TreeController.php b/src/DataObject/Controller/TreeController.php index cda52da8d..fdbb08ca6 100644 --- a/src/DataObject/Controller/TreeController.php +++ b/src/DataObject/Controller/TreeController.php @@ -19,7 +19,6 @@ use OpenApi\Attributes\Get; use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController; use Pimcore\Bundle\StudioBackendBundle\DataIndex\Request\DataObjectParameters; -use Pimcore\Bundle\StudioBackendBundle\DataObject\Attribute\Parameter\Query\ClassNameParameter; use Pimcore\Bundle\StudioBackendBundle\DataObject\Attribute\Response\Property\AnyOfDataObjects; use Pimcore\Bundle\StudioBackendBundle\DataObject\Service\DataObjectServiceInterface; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\AccessDeniedException; @@ -37,6 +36,7 @@ use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Parameter\Query\PathIncludeDescendantsParameter; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Parameter\Query\PathIncludeParentParameter; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Parameter\Query\PathParameter; +use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Parameter\Query\TextFieldParameter; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\Content\CollectionJson; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\DefaultResponses; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\SuccessResponse; @@ -85,12 +85,17 @@ public function __construct( #[PathParameter] #[PathIncludeParentParameter] #[PathIncludeDescendantsParameter] - #[ClassNameParameter] + #[TextFieldParameter( + name: 'className', + description: 'Filter by class.', + example: 'Car' + )] #[SuccessResponse( description: 'data_object_get_tree_success_response', content: new CollectionJson(new AnyOfDataObjects()) )] #[DefaultResponses([ + HttpResponseCodes::BAD_REQUEST, HttpResponseCodes::UNAUTHORIZED, HttpResponseCodes::NOT_FOUND, ])]