Updated to API Platform 4

This commit is contained in:
Jan Böhmer 2025-08-04 23:32:42 +02:00
parent 6c229ccb3a
commit c834058678
7 changed files with 1251 additions and 180 deletions

View file

@ -12,7 +12,9 @@
"ext-json": "*", "ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"amphp/http-client": "^5.1", "amphp/http-client": "^5.1",
"api-platform/core": "^3.1", "api-platform/doctrine-orm": "^4.1",
"api-platform/symfony": "^4.0.0",
"api-platform/json-api": "^4.0.0",
"beberlei/doctrineextensions": "^1.2", "beberlei/doctrineextensions": "^1.2",
"brick/math": "^0.13.1", "brick/math": "^0.13.1",
"composer/ca-bundle": "^1.5", "composer/ca-bundle": "^1.5",
@ -84,6 +86,7 @@
"symfony/web-link": "7.3.*", "symfony/web-link": "7.3.*",
"symfony/webpack-encore-bundle": "^v2.0.1", "symfony/webpack-encore-bundle": "^v2.0.1",
"symfony/yaml": "7.3.*", "symfony/yaml": "7.3.*",
"symplify/easy-coding-standard": "^12.5.20",
"tecnickcom/tc-lib-barcode": "^2.1.4", "tecnickcom/tc-lib-barcode": "^2.1.4",
"twig/cssinliner-extra": "^3.0", "twig/cssinliner-extra": "^3.0",
"twig/extra-bundle": "^3.8", "twig/extra-bundle": "^3.8",
@ -92,8 +95,7 @@
"twig/intl-extra": "^3.8", "twig/intl-extra": "^3.8",
"twig/markdown-extra": "^3.8", "twig/markdown-extra": "^3.8",
"twig/string-extra": "^3.8", "twig/string-extra": "^3.8",
"web-auth/webauthn-symfony-bundle": "^4.0.0", "web-auth/webauthn-symfony-bundle": "^4.0.0"
"symplify/easy-coding-standard": "^12.5.20"
}, },
"require-dev": { "require-dev": {
"dama/doctrine-test-bundle": "^v8.0.0", "dama/doctrine-test-bundle": "^v8.0.0",

1398
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -30,7 +30,7 @@ return [
Jbtronics\DompdfFontLoaderBundle\DompdfFontLoaderBundle::class => ['all' => true], Jbtronics\DompdfFontLoaderBundle\DompdfFontLoaderBundle::class => ['all' => true],
KnpU\OAuth2ClientBundle\KnpUOAuth2ClientBundle::class => ['all' => true], KnpU\OAuth2ClientBundle\KnpUOAuth2ClientBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Jbtronics\SettingsBundle\JbtronicsSettingsBundle::class => ['all' => true], Jbtronics\SettingsBundle\JbtronicsSettingsBundle::class => ['all' => true],
Jbtronics\TranslationEditorBundle\JbtronicsTranslationEditorBundle::class => ['dev' => true], Jbtronics\TranslationEditorBundle\JbtronicsTranslationEditorBundle::class => ['dev' => true],
\ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
]; ];

View file

@ -32,10 +32,9 @@ api_platform:
pagination_client_items_per_page: true # Allow clients to override the default items per page pagination_client_items_per_page: true # Allow clients to override the default items per page
keep_legacy_inflector: false
# Need to be true, or some tests will fail # Need to be true, or some tests will fail
use_symfony_listeners: true use_symfony_listeners: true
serializer: serializer:
# Change this to false later, to remove the hydra prefix on the API # Change this to false later, to remove the hydra prefix on the API
hydra_prefix: true hydra_prefix: true

View file

@ -70,4 +70,4 @@ class PropertyMetadataFactory implements PropertyMetadataFactoryInterface
return $metadata; return $metadata;
} }
} }

View file

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace App\Serializer\APIPlatform; namespace App\Serializer\APIPlatform;
use ApiPlatform\Metadata\Exception\ResourceClassNotFoundException; use ApiPlatform\Metadata\Exception\ResourceClassNotFoundException;
use ApiPlatform\Api\IriConverterInterface; use ApiPlatform\Metadata\IriConverterInterface;
use ApiPlatform\Metadata\Operation; use ApiPlatform\Metadata\Operation;
use ApiPlatform\Metadata\Post; use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface; use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
@ -121,4 +121,4 @@ class DetermineTypeFromElementIRIDenormalizer implements DenormalizerInterface,
return $tmp; return $tmp;
} }
} }

View file

@ -1,16 +1,16 @@
{ {
"api-platform/core": { "api-platform/symfony": {
"version": "3.4", "version": "4.1",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "3.3", "version": "4.0",
"ref": "74b45ac570c57eb1fbe56c984091a9ff87e18bab" "ref": "e9952e9f393c2d048f10a78f272cd35e807d972b"
}, },
"files": [ "files": [
"config/packages/api_platform.yaml", "./config/packages/api_platform.yaml",
"config/routes/api_platform.yaml", "./config/routes/api_platform.yaml",
"src/ApiResource/.gitignore" "./src/ApiResource/.gitignore"
] ]
}, },
"beberlei/assert": { "beberlei/assert": {