From 02a343bb139b112752730177cfbd582b6173059d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Thu, 14 Oct 2021 10:55:32 +0200 Subject: [PATCH] add API Platform --- composer.json | 1 + config/bundles.php | 1 + config/packages/api_platform.yaml | 7 +++++++ config/routes/api_platform.yaml | 4 ++++ symfony.lock | 20 ++++++++++++++++++++ 5 files changed, 33 insertions(+) create mode 100644 config/packages/api_platform.yaml create mode 100644 config/routes/api_platform.yaml diff --git a/composer.json b/composer.json index 5ca2e50..67e664c 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,7 @@ "php": ">=7.1.3", "ext-ctype": "*", "ext-iconv": "*", + "api-platform/core": "^2.6", "composer/package-versions-deprecated": "1.11.99.1", "doctrine/annotations": "^1.0", "doctrine/doctrine-bundle": "^2.3", diff --git a/config/bundles.php b/config/bundles.php index a065b7d..87a56e8 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -13,4 +13,5 @@ Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], + ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], ]; diff --git a/config/packages/api_platform.yaml b/config/packages/api_platform.yaml new file mode 100644 index 0000000..2eb7b4c --- /dev/null +++ b/config/packages/api_platform.yaml @@ -0,0 +1,7 @@ +api_platform: + mapping: + paths: ['%kernel.project_dir%/src/Entity'] + patch_formats: + json: ['application/merge-patch+json'] + swagger: + versions: [3] diff --git a/config/routes/api_platform.yaml b/config/routes/api_platform.yaml new file mode 100644 index 0000000..38f11cb --- /dev/null +++ b/config/routes/api_platform.yaml @@ -0,0 +1,4 @@ +api_platform: + resource: . + type: api_platform + prefix: /api diff --git a/symfony.lock b/symfony.lock index 84157da..c009477 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,18 @@ { + "api-platform/core": { + "version": "2.6", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "2.5", + "ref": "05b57782a78c21a664a42055dc11cf1954ca36bb" + }, + "files": [ + "config/routes/api_platform.yaml", + "config/packages/api_platform.yaml", + "src/Entity/.gitignore" + ] + }, "composer/package-versions-deprecated": { "version": "1.11.99.1" }, @@ -69,6 +83,9 @@ "egulias/email-validator": { "version": "3.1.1" }, + "fig/link-util": { + "version": "1.2.0" + }, "friendsofphp/proxy-manager-lts": { "version": "v1.0.3" }, @@ -597,5 +614,8 @@ }, "webmozart/assert": { "version": "1.10.0" + }, + "willdurand/negotiation": { + "version": "3.0.0" } }