diff --git a/src/OpenApi/Attributes/Response/Content/ItemsJson.php b/src/OpenApi/Attributes/Content/ItemsJson.php similarity index 98% rename from src/OpenApi/Attributes/Response/Content/ItemsJson.php rename to src/OpenApi/Attributes/Content/ItemsJson.php index b423c5415..8de441f63 100644 --- a/src/OpenApi/Attributes/Response/Content/ItemsJson.php +++ b/src/OpenApi/Attributes/Content/ItemsJson.php @@ -14,7 +14,7 @@ * @license http://www.pimcore.org/license GPLv3 and PCL */ -namespace Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Content; +namespace Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Content; use OpenApi\Attributes\Items; use OpenApi\Attributes\JsonContent; diff --git a/src/OpenApi/Attributes/Request/ElementPropertyRequestBody.php b/src/OpenApi/Attributes/Request/ElementPropertyRequestBody.php index f19eec518..a508b35e8 100644 --- a/src/OpenApi/Attributes/Request/ElementPropertyRequestBody.php +++ b/src/OpenApi/Attributes/Request/ElementPropertyRequestBody.php @@ -17,9 +17,8 @@ namespace Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Request; use Attribute; -use OpenApi\Attributes\Items; -use OpenApi\Attributes\JsonContent; use OpenApi\Attributes\RequestBody; +use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Content\ItemsJson; use Pimcore\Bundle\StudioBackendBundle\Property\Schema\UpdateElementProperty; #[Attribute(Attribute::TARGET_METHOD)] @@ -29,10 +28,7 @@ public function __construct() { parent::__construct( required: true, - content: new JsonContent( - type: 'array', - items: new Items(ref: UpdateElementProperty::class) - ) + content: new ItemsJson(UpdateElementProperty::class) ); } } diff --git a/src/Property/Controller/CollectionController.php b/src/Property/Controller/CollectionController.php index 357be46ec..763584c7e 100644 --- a/src/Property/Controller/CollectionController.php +++ b/src/Property/Controller/CollectionController.php @@ -19,9 +19,9 @@ use OpenApi\Attributes\Get; use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController; use Pimcore\Bundle\StudioBackendBundle\Exception\InvalidQueryTypeException; +use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Content\ItemsJson; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Parameters\Query\ElementTypeParameter; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Parameters\Query\FilterParameter; -use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Content\ItemsJson; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\BadRequestResponse; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\MethodNotAllowedResponse; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\UnauthorizedResponse; diff --git a/src/Property/Controller/Element/GetController.php b/src/Property/Controller/Element/GetController.php index e7f150453..3aa1eec7b 100644 --- a/src/Property/Controller/Element/GetController.php +++ b/src/Property/Controller/Element/GetController.php @@ -18,9 +18,9 @@ use OpenApi\Attributes\Get; use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController; +use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Content\ItemsJson; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Parameters\Path\ElementTypeParameter; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Parameters\Path\IdParameter; -use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Content\ItemsJson; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\MethodNotAllowedResponse; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\NotFoundResponse; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\UnauthorizedResponse; diff --git a/src/Property/Controller/Element/PutController.php b/src/Property/Controller/Element/PutController.php index 00b7a0f4a..5cdb96f7a 100644 --- a/src/Property/Controller/Element/PutController.php +++ b/src/Property/Controller/Element/PutController.php @@ -18,10 +18,10 @@ use OpenApi\Attributes\Put; use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController; +use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Content\ItemsJson; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Parameters\Path\ElementTypeParameter; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Parameters\Path\IdParameter; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Request\ElementPropertyRequestBody; -use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Content\ItemsJson; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\MethodNotAllowedResponse; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\NotFoundResponse; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\UnauthorizedResponse; diff --git a/src/Property/Repository.php b/src/Property/Repository.php index 8d10e4343..6635edb5c 100644 --- a/src/Property/Repository.php +++ b/src/Property/Repository.php @@ -73,7 +73,7 @@ public function updatePredefinedProperty(string $id, UpdatePredefinedProperty $p $predefined->setData($property->getData()); $predefined->setConfig($property->getConfig()); $predefined->setCtype($property->getCtype()); - $predefined->setInheritable($property->getInheritable()); + $predefined->setInheritable($property->isInheritable()); $predefined->save(); diff --git a/src/Property/Service/PropertyService.php b/src/Property/Service/PropertyService.php index ffdc64eb6..f21bb8b02 100644 --- a/src/Property/Service/PropertyService.php +++ b/src/Property/Service/PropertyService.php @@ -56,7 +56,7 @@ public function updateElementProperties(string $elementType, int $id, UpdateElem $property->setName($updateProperty->getKey()); $property->setData($updateProperty->getData()); $property->setInheritable($updateProperty->getInheritable()); - $properties[] = $property; + $properties[$updateProperty->getKey()] = $property; } $element->setProperties($properties); $element->save();