From df1203b89acac6a458dbe7701991db9acdfde568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 12 Sep 2023 17:55:15 +0200 Subject: [PATCH] [api-platform/core] prevent a deprecation warning and sync with upstream (#1227) * [api-platform/core] prevent a deprecation warning and sync with upstream * update post install --- api-platform/core/2.1/post-install.txt | 6 ++++-- api-platform/core/2.5/post-install.txt | 6 ++++-- api-platform/core/3.0/post-install.txt | 4 +++- .../core/3.1/config/packages/api_platform.yaml | 10 ++++++++++ api-platform/core/3.1/config/routes/api_platform.yaml | 4 ++++ api-platform/core/3.1/manifest.json | 9 +++++++++ api-platform/core/3.1/post-install.txt | 10 ++++++++++ api-platform/core/3.1/src/ApiResource/.gitignore | 0 8 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 api-platform/core/3.1/config/packages/api_platform.yaml create mode 100644 api-platform/core/3.1/config/routes/api_platform.yaml create mode 100644 api-platform/core/3.1/manifest.json create mode 100644 api-platform/core/3.1/post-install.txt create mode 100644 api-platform/core/3.1/src/ApiResource/.gitignore diff --git a/api-platform/core/2.1/post-install.txt b/api-platform/core/2.1/post-install.txt index 1b67b54a..613c2b80 100644 --- a/api-platform/core/2.1/post-install.txt +++ b/api-platform/core/2.1/post-install.txt @@ -1,8 +1,10 @@ * Your API is almost ready: - 1. Create your first API resource in src/Entity; + 1. Create your first API resource in src/ApiResource; 2. Go to /api to browse your API + * Using MakerBundle? Try php bin/console make:entity --api-resource + * To enable the GraphQL support, run composer require webonyx/graphql-php, then browse /api/graphql. - * Read the documentation at https://api-platform.com/docs + * Read the documentation at https://api-platform.com/docs/ diff --git a/api-platform/core/2.5/post-install.txt b/api-platform/core/2.5/post-install.txt index 1b67b54a..613c2b80 100644 --- a/api-platform/core/2.5/post-install.txt +++ b/api-platform/core/2.5/post-install.txt @@ -1,8 +1,10 @@ * Your API is almost ready: - 1. Create your first API resource in src/Entity; + 1. Create your first API resource in src/ApiResource; 2. Go to /api to browse your API + * Using MakerBundle? Try php bin/console make:entity --api-resource + * To enable the GraphQL support, run composer require webonyx/graphql-php, then browse /api/graphql. - * Read the documentation at https://api-platform.com/docs + * Read the documentation at https://api-platform.com/docs/ diff --git a/api-platform/core/3.0/post-install.txt b/api-platform/core/3.0/post-install.txt index 5cfe0951..613c2b80 100644 --- a/api-platform/core/3.0/post-install.txt +++ b/api-platform/core/3.0/post-install.txt @@ -2,7 +2,9 @@ 1. Create your first API resource in src/ApiResource; 2. Go to /api to browse your API + * Using MakerBundle? Try php bin/console make:entity --api-resource + * To enable the GraphQL support, run composer require webonyx/graphql-php, then browse /api/graphql. - * Read the documentation at https://api-platform.com/docs + * Read the documentation at https://api-platform.com/docs/ diff --git a/api-platform/core/3.1/config/packages/api_platform.yaml b/api-platform/core/3.1/config/packages/api_platform.yaml new file mode 100644 index 00000000..41c79934 --- /dev/null +++ b/api-platform/core/3.1/config/packages/api_platform.yaml @@ -0,0 +1,10 @@ +api_platform: + title: Hello API Platform + version: 1.0.0 + # Good defaults for REST APIs + defaults: + stateless: true + cache_headers: + vary: ['Content-Type', 'Authorization', 'Origin'] + extra_properties: + standard_put: true diff --git a/api-platform/core/3.1/config/routes/api_platform.yaml b/api-platform/core/3.1/config/routes/api_platform.yaml new file mode 100644 index 00000000..38f11cba --- /dev/null +++ b/api-platform/core/3.1/config/routes/api_platform.yaml @@ -0,0 +1,4 @@ +api_platform: + resource: . + type: api_platform + prefix: /api diff --git a/api-platform/core/3.1/manifest.json b/api-platform/core/3.1/manifest.json new file mode 100644 index 00000000..af164523 --- /dev/null +++ b/api-platform/core/3.1/manifest.json @@ -0,0 +1,9 @@ +{ + "bundles": { + "ApiPlatform\\Symfony\\Bundle\\ApiPlatformBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/", + "src/": "%SRC_DIR%/" + } +} diff --git a/api-platform/core/3.1/post-install.txt b/api-platform/core/3.1/post-install.txt new file mode 100644 index 00000000..613c2b80 --- /dev/null +++ b/api-platform/core/3.1/post-install.txt @@ -0,0 +1,10 @@ + * Your API is almost ready: + 1. Create your first API resource in src/ApiResource; + 2. Go to /api to browse your API + + * Using MakerBundle? Try php bin/console make:entity --api-resource + + * To enable the GraphQL support, run composer require webonyx/graphql-php, + then browse /api/graphql. + + * Read the documentation at https://api-platform.com/docs/ diff --git a/api-platform/core/3.1/src/ApiResource/.gitignore b/api-platform/core/3.1/src/ApiResource/.gitignore new file mode 100644 index 00000000..e69de29b