Skip to content

Commit

Permalink
feat: Upgrade to ApiPlatform 3.2
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Switched to ApiPlatform 3.2, make sure to upgrade `bundles.php` file and `api_platform.yaml` configuration
  • Loading branch information
ambroisemaupate committed Feb 28, 2024
1 parent 678e0eb commit 4962d87
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"ext-openssl": "*",
"ext-simplexml": "*",
"ext-zip": "*",
"api-platform/core": "~2.7.0",
"api-platform/core": "^3.2.14",
"codercat/jwk-to-pem": "^1.0",
"composer/package-versions-deprecated": "1.11.99.3",
"doctrine/annotations": "^1.0",
Expand Down Expand Up @@ -122,7 +122,6 @@
"symfony/stopwatch": "6.4.*",
"symfony/string": "6.4.*",
"symfony/translation": "6.4.*",
"symfony/translation-contracts": "^2.3",
"symfony/twig-bundle": "6.4.*",
"symfony/validator": "6.4.*",
"symfony/web-link": "6.4.*",
Expand Down
1 change: 0 additions & 1 deletion config/api_resources/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ RZ\Roadiz\CoreBundle\Entity\User:
class: ApiPlatform\Metadata\Get
# Path must be different from item operation to avoid conflict
uriTemplate: '/me'
itemUriTemplate: /users/{id}
provider: RZ\Roadiz\UserBundle\State\UserTokenProvider
output: RZ\Roadiz\UserBundle\Api\Dto\UserOutput
normalizationContext:
Expand Down
2 changes: 1 addition & 1 deletion config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
RZ\InterventionRequestBundle\RZInterventionRequestBundle::class => ['all' => true],
Sentry\SentryBundle\SentryBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Limenius\LiformBundle\LimeniusLiformBundle::class => ['all' => true],
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
Expand Down
5 changes: 4 additions & 1 deletion config/packages/api_platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ api_platform:
version: '%env(string:APP_VERSION)%'
enable_swagger_ui: true
enable_re_doc: true
metadata_backward_compatibility_layer: false
graphql:
graphiql:
enabled: false
Expand All @@ -27,6 +26,10 @@ api_platform:
items_per_page_parameter_name: itemsPerPage

defaults:
stateless: true
extra_properties:
standard_put: true
rfc_7807_compliant_errors: false
enable_max_depth: true
normalization_context:
skip_null_values: true
Expand Down
2 changes: 1 addition & 1 deletion lib/EntityGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"squizlabs/php_codesniffer": "^3.5",
"phpstan/phpstan": "^1.5.3",
"atoum/atoum": "^4.0.0",
"api-platform/core": "~2.7.0"
"api-platform/core": "^3.2.14"
},
"extra": {
"branch-alias": {
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"ext-iconv": "*",
"ext-zip": "*",
"ext-json": "*",
"api-platform/core": "~2.7.0",
"api-platform/core": "^3.2.14",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.8.1",
"doctrine/doctrine-migrations-bundle": "^3.1",
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/src/Api/Filter/ArchiveFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function isDateField(string $property, string $resourceClass): bool
*/
protected function filterProperty(
string $property,
$value,
mixed $value,
QueryBuilder $queryBuilder,
QueryNameGeneratorInterface $queryNameGenerator,
string $resourceClass,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class CopyrightValidFilter extends AbstractFilter

protected function filterProperty(
string $property,
$value,
mixed $value,
QueryBuilder $queryBuilder,
QueryNameGeneratorInterface $queryNameGenerator,
string $resourceClass,
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/src/Api/Filter/IntersectionFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class IntersectionFilter extends AbstractFilter
*/
protected function filterProperty(
string $property,
$value,
mixed $value,
QueryBuilder $queryBuilder,
QueryNameGeneratorInterface $queryNameGenerator,
string $resourceClass,
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/src/Api/Filter/LocaleFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(
protected function filterProperty(
string $property,
$value,
mixed $value,
QueryBuilder $queryBuilder,
QueryNameGeneratorInterface $queryNameGenerator,
string $resourceClass,
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/src/Api/Filter/NotFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class NotFilter extends AbstractFilter

protected function filterProperty(
string $property,
$value,
mixed $value,
QueryBuilder $queryBuilder,
QueryNameGeneratorInterface $queryNameGenerator,
string $resourceClass,
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizUserBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.1",
"api-platform/core": "~2.7.0",
"api-platform/core": "^3.2.14",
"symfony/framework-bundle": "6.4.*",
"symfony/rate-limiter": "6.4.*",
"symfony/lock": "6.4.*",
Expand Down
1 change: 0 additions & 1 deletion lib/RoadizUserBundle/config/api_resources/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ RZ\Roadiz\CoreBundle\Entity\User:
class: ApiPlatform\Metadata\Get
# Path must be different from item operation to avoid conflict
uriTemplate: '/me'
itemUriTemplate: /users/{id}
provider: RZ\Roadiz\UserBundle\State\UserTokenProvider
output: RZ\Roadiz\UserBundle\Api\Dto\UserOutput
normalizationContext:
Expand Down

0 comments on commit 4962d87

Please sign in to comment.