From 68c3fe4cea9b53da615b5667aff3239068208c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 23 Sep 2024 15:55:50 +0200 Subject: [PATCH 1/4] [api-platform/core] Support for v4 --- .../core/3.4/config/packages/api_platform.yaml | 7 +++++++ api-platform/core/3.4/config/routes/api_platform.yaml | 4 ++++ api-platform/core/3.4/manifest.json | 9 +++++++++ api-platform/core/3.4/post-install.txt | 10 ++++++++++ api-platform/core/3.4/src/ApiResource/.gitignore | 0 .../symfony/3.4/config/packages/api_platform.yaml | 7 +++++++ .../symfony/3.4/config/routes/api_platform.yaml | 4 ++++ api-platform/symfony/3.4/manifest.json | 9 +++++++++ api-platform/symfony/3.4/post-install.txt | 10 ++++++++++ api-platform/symfony/3.4/src/ApiResource/.gitignore | 0 10 files changed, 60 insertions(+) create mode 100644 api-platform/core/3.4/config/packages/api_platform.yaml create mode 100644 api-platform/core/3.4/config/routes/api_platform.yaml create mode 100644 api-platform/core/3.4/manifest.json create mode 100644 api-platform/core/3.4/post-install.txt create mode 100644 api-platform/core/3.4/src/ApiResource/.gitignore create mode 100644 api-platform/symfony/3.4/config/packages/api_platform.yaml create mode 100644 api-platform/symfony/3.4/config/routes/api_platform.yaml create mode 100644 api-platform/symfony/3.4/manifest.json create mode 100644 api-platform/symfony/3.4/post-install.txt create mode 100644 api-platform/symfony/3.4/src/ApiResource/.gitignore diff --git a/api-platform/core/3.4/config/packages/api_platform.yaml b/api-platform/core/3.4/config/packages/api_platform.yaml new file mode 100644 index 000000000..02f295ab0 --- /dev/null +++ b/api-platform/core/3.4/config/packages/api_platform.yaml @@ -0,0 +1,7 @@ +api_platform: + title: Hello API Platform + version: 1.0.0 + defaults: + stateless: true + cache_headers: + vary: ['Content-Type', 'Authorization', 'Origin'] diff --git a/api-platform/core/3.4/config/routes/api_platform.yaml b/api-platform/core/3.4/config/routes/api_platform.yaml new file mode 100644 index 000000000..38f11cba8 --- /dev/null +++ b/api-platform/core/3.4/config/routes/api_platform.yaml @@ -0,0 +1,4 @@ +api_platform: + resource: . + type: api_platform + prefix: /api diff --git a/api-platform/core/3.4/manifest.json b/api-platform/core/3.4/manifest.json new file mode 100644 index 000000000..af1645232 --- /dev/null +++ b/api-platform/core/3.4/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.4/post-install.txt b/api-platform/core/3.4/post-install.txt new file mode 100644 index 000000000..613c2b800 --- /dev/null +++ b/api-platform/core/3.4/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.4/src/ApiResource/.gitignore b/api-platform/core/3.4/src/ApiResource/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/api-platform/symfony/3.4/config/packages/api_platform.yaml b/api-platform/symfony/3.4/config/packages/api_platform.yaml new file mode 100644 index 000000000..02f295ab0 --- /dev/null +++ b/api-platform/symfony/3.4/config/packages/api_platform.yaml @@ -0,0 +1,7 @@ +api_platform: + title: Hello API Platform + version: 1.0.0 + defaults: + stateless: true + cache_headers: + vary: ['Content-Type', 'Authorization', 'Origin'] diff --git a/api-platform/symfony/3.4/config/routes/api_platform.yaml b/api-platform/symfony/3.4/config/routes/api_platform.yaml new file mode 100644 index 000000000..38f11cba8 --- /dev/null +++ b/api-platform/symfony/3.4/config/routes/api_platform.yaml @@ -0,0 +1,4 @@ +api_platform: + resource: . + type: api_platform + prefix: /api diff --git a/api-platform/symfony/3.4/manifest.json b/api-platform/symfony/3.4/manifest.json new file mode 100644 index 000000000..af1645232 --- /dev/null +++ b/api-platform/symfony/3.4/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/symfony/3.4/post-install.txt b/api-platform/symfony/3.4/post-install.txt new file mode 100644 index 000000000..613c2b800 --- /dev/null +++ b/api-platform/symfony/3.4/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/symfony/3.4/src/ApiResource/.gitignore b/api-platform/symfony/3.4/src/ApiResource/.gitignore new file mode 100644 index 000000000..e69de29bb From 9fa3fa798341952d87642cf5c179d5a93c115f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 25 Sep 2024 11:08:49 +0200 Subject: [PATCH 2/4] fix --- .../config/packages/api_platform.yaml | 0 .../config/routes/api_platform.yaml | 0 api-platform/core/{3.4 => 4.0}/manifest.json | 0 .../core/{3.4 => 4.0}/post-install.txt | 0 .../{3.4 => 4.0}/src/ApiResource/.gitignore | 0 .../3.3/config/packages/api_platform.yaml | 18 ++++++++++++++++++ .../config/routes/api_platform.yaml | 0 .../symfony/{3.4 => 3.3}/manifest.json | 0 .../symfony/{3.4 => 3.3}/post-install.txt | 0 .../{3.4 => 3.3}/src/ApiResource/.gitignore | 0 .../config/packages/api_platform.yaml | 0 .../4.0/config/routes/api_platform.yaml | 4 ++++ api-platform/symfony/4.0/manifest.json | 9 +++++++++ api-platform/symfony/4.0/post-install.txt | 10 ++++++++++ .../symfony/4.0/src/ApiResource/.gitignore | 0 15 files changed, 41 insertions(+) rename api-platform/core/{3.4 => 4.0}/config/packages/api_platform.yaml (100%) rename api-platform/core/{3.4 => 4.0}/config/routes/api_platform.yaml (100%) rename api-platform/core/{3.4 => 4.0}/manifest.json (100%) rename api-platform/core/{3.4 => 4.0}/post-install.txt (100%) rename api-platform/core/{3.4 => 4.0}/src/ApiResource/.gitignore (100%) create mode 100644 api-platform/symfony/3.3/config/packages/api_platform.yaml rename api-platform/symfony/{3.4 => 3.3}/config/routes/api_platform.yaml (100%) rename api-platform/symfony/{3.4 => 3.3}/manifest.json (100%) rename api-platform/symfony/{3.4 => 3.3}/post-install.txt (100%) rename api-platform/symfony/{3.4 => 3.3}/src/ApiResource/.gitignore (100%) rename api-platform/symfony/{3.4 => 4.0}/config/packages/api_platform.yaml (100%) create mode 100644 api-platform/symfony/4.0/config/routes/api_platform.yaml create mode 100644 api-platform/symfony/4.0/manifest.json create mode 100644 api-platform/symfony/4.0/post-install.txt create mode 100644 api-platform/symfony/4.0/src/ApiResource/.gitignore diff --git a/api-platform/core/3.4/config/packages/api_platform.yaml b/api-platform/core/4.0/config/packages/api_platform.yaml similarity index 100% rename from api-platform/core/3.4/config/packages/api_platform.yaml rename to api-platform/core/4.0/config/packages/api_platform.yaml diff --git a/api-platform/core/3.4/config/routes/api_platform.yaml b/api-platform/core/4.0/config/routes/api_platform.yaml similarity index 100% rename from api-platform/core/3.4/config/routes/api_platform.yaml rename to api-platform/core/4.0/config/routes/api_platform.yaml diff --git a/api-platform/core/3.4/manifest.json b/api-platform/core/4.0/manifest.json similarity index 100% rename from api-platform/core/3.4/manifest.json rename to api-platform/core/4.0/manifest.json diff --git a/api-platform/core/3.4/post-install.txt b/api-platform/core/4.0/post-install.txt similarity index 100% rename from api-platform/core/3.4/post-install.txt rename to api-platform/core/4.0/post-install.txt diff --git a/api-platform/core/3.4/src/ApiResource/.gitignore b/api-platform/core/4.0/src/ApiResource/.gitignore similarity index 100% rename from api-platform/core/3.4/src/ApiResource/.gitignore rename to api-platform/core/4.0/src/ApiResource/.gitignore diff --git a/api-platform/symfony/3.3/config/packages/api_platform.yaml b/api-platform/symfony/3.3/config/packages/api_platform.yaml new file mode 100644 index 000000000..e4233dc3c --- /dev/null +++ b/api-platform/symfony/3.3/config/packages/api_platform.yaml @@ -0,0 +1,18 @@ +api_platform: + title: Hello API Platform + version: 1.0.0 + formats: + jsonld: ['application/ld+json'] + docs_formats: + jsonld: ['application/ld+json'] + jsonopenapi: ['application/vnd.openapi+json'] + html: ['text/html'] + defaults: + stateless: true + cache_headers: + vary: ['Content-Type', 'Authorization', 'Origin'] + extra_properties: + standard_put: true + rfc_7807_compliant_errors: true + keep_legacy_inflector: false + use_symfony_listeners: true diff --git a/api-platform/symfony/3.4/config/routes/api_platform.yaml b/api-platform/symfony/3.3/config/routes/api_platform.yaml similarity index 100% rename from api-platform/symfony/3.4/config/routes/api_platform.yaml rename to api-platform/symfony/3.3/config/routes/api_platform.yaml diff --git a/api-platform/symfony/3.4/manifest.json b/api-platform/symfony/3.3/manifest.json similarity index 100% rename from api-platform/symfony/3.4/manifest.json rename to api-platform/symfony/3.3/manifest.json diff --git a/api-platform/symfony/3.4/post-install.txt b/api-platform/symfony/3.3/post-install.txt similarity index 100% rename from api-platform/symfony/3.4/post-install.txt rename to api-platform/symfony/3.3/post-install.txt diff --git a/api-platform/symfony/3.4/src/ApiResource/.gitignore b/api-platform/symfony/3.3/src/ApiResource/.gitignore similarity index 100% rename from api-platform/symfony/3.4/src/ApiResource/.gitignore rename to api-platform/symfony/3.3/src/ApiResource/.gitignore diff --git a/api-platform/symfony/3.4/config/packages/api_platform.yaml b/api-platform/symfony/4.0/config/packages/api_platform.yaml similarity index 100% rename from api-platform/symfony/3.4/config/packages/api_platform.yaml rename to api-platform/symfony/4.0/config/packages/api_platform.yaml diff --git a/api-platform/symfony/4.0/config/routes/api_platform.yaml b/api-platform/symfony/4.0/config/routes/api_platform.yaml new file mode 100644 index 000000000..38f11cba8 --- /dev/null +++ b/api-platform/symfony/4.0/config/routes/api_platform.yaml @@ -0,0 +1,4 @@ +api_platform: + resource: . + type: api_platform + prefix: /api diff --git a/api-platform/symfony/4.0/manifest.json b/api-platform/symfony/4.0/manifest.json new file mode 100644 index 000000000..af1645232 --- /dev/null +++ b/api-platform/symfony/4.0/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/symfony/4.0/post-install.txt b/api-platform/symfony/4.0/post-install.txt new file mode 100644 index 000000000..613c2b800 --- /dev/null +++ b/api-platform/symfony/4.0/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/symfony/4.0/src/ApiResource/.gitignore b/api-platform/symfony/4.0/src/ApiResource/.gitignore new file mode 100644 index 000000000..e69de29bb From 0cdd38c01a1d9d25180e0eb079752ffb7dbbbc9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 25 Sep 2024 11:10:11 +0200 Subject: [PATCH 3/4] fix graphql --- api-platform/core/4.0/post-install.txt | 2 +- api-platform/symfony/4.0/post-install.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api-platform/core/4.0/post-install.txt b/api-platform/core/4.0/post-install.txt index 613c2b800..82bb10a69 100644 --- a/api-platform/core/4.0/post-install.txt +++ b/api-platform/core/4.0/post-install.txt @@ -4,7 +4,7 @@ * Using MakerBundle? Try php bin/console make:entity --api-resource - * To enable the GraphQL support, run composer require webonyx/graphql-php, + * To enable the GraphQL support, run composer require api-platform/graphql, then browse /api/graphql. * Read the documentation at https://api-platform.com/docs/ diff --git a/api-platform/symfony/4.0/post-install.txt b/api-platform/symfony/4.0/post-install.txt index 613c2b800..82bb10a69 100644 --- a/api-platform/symfony/4.0/post-install.txt +++ b/api-platform/symfony/4.0/post-install.txt @@ -4,7 +4,7 @@ * Using MakerBundle? Try php bin/console make:entity --api-resource - * To enable the GraphQL support, run composer require webonyx/graphql-php, + * To enable the GraphQL support, run composer require api-platform/graphql, then browse /api/graphql. * Read the documentation at https://api-platform.com/docs/ From 8ee4ac6036273dc5bc4e86a724d9a94cfced892c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 25 Sep 2024 11:10:29 +0200 Subject: [PATCH 4/4] fix graphql --- api-platform/core/4.0/post-install.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-platform/core/4.0/post-install.txt b/api-platform/core/4.0/post-install.txt index 82bb10a69..613c2b800 100644 --- a/api-platform/core/4.0/post-install.txt +++ b/api-platform/core/4.0/post-install.txt @@ -4,7 +4,7 @@ * Using MakerBundle? Try php bin/console make:entity --api-resource - * To enable the GraphQL support, run composer require api-platform/graphql, + * To enable the GraphQL support, run composer require webonyx/graphql-php, then browse /api/graphql. * Read the documentation at https://api-platform.com/docs/