diff --git a/.gitattributes b/.gitattributes
index 5988d06499a..a2afb552166 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,14 +1,18 @@
-/.editorconfig export-ignore
-/.gitattributes export-ignore
-/.github export-ignore
-/.gitignore export-ignore
-/.php_cs.dist export-ignore
+*.sh export-ignore
+.editorconfig export-ignore
+.gitattributes export-ignore
+.github export-ignore
+.gitignore export-ignore
+.php-cs-fixer.dist.php export-ignore
+phpstan.neon.dist export-ignore
+phpunit.xml.dist export-ignore
+/.commitlintrc export-ignore
/appveyor.yml export-ignore
/behat.yml.dist export-ignore
+/codecov.yml
/docs export-ignore
/features export-ignore
-/phpstan.neon.dist export-ignore
-/phpunit.xml.dist export-ignore
+/package-lock.json export-ignore
+/pmu.baseline
/tests export-ignore
-/update-js.sh export-ignore
/yarn.lock export-ignore
diff --git a/.gitignore b/.gitignore
index 57d0a18c303..b44218aedc7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.idea
*.log
/.php-cs-fixer.php
/.php-cs-fixer.cache
diff --git a/composer.json b/composer.json
index 50fe150e926..cb1413fdf9d 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,66 @@
{
- "name": "api-platform/core",
+ "authors": [
+ {
+ "name": "Kévin Dunglas",
+ "email": "kevin@dunglas.fr",
+ "homepage": "https://dunglas.fr"
+ }
+ ],
+ "autoload": {
+ "psr-4": {
+ "ApiPlatform\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "ApiPlatform\\Tests\\": "tests/",
+ "App\\": "tests/Fixtures/app/var/tmp/src/"
+ }
+ },
+ "config": {
+ "preferred-install": {
+ "*": "dist"
+ },
+ "sort-packages": true,
+ "allow-plugins": {
+ "composer/package-versions-deprecated": true,
+ "phpstan/extension-installer": true,
+ "php-http/discovery": true,
+ "soyuka/pmu": true
+ }
+ },
+ "conflict": {
+ "doctrine/common": "<3.2.2",
+ "doctrine/dbal": "<2.10",
+ "doctrine/orm": "<2.14.0",
+ "doctrine/mongodb-odm": "<2.4",
+ "doctrine/persistence": "<1.3",
+ "symfony/framework-bundle": "6.4.6 || 7.0.6",
+ "symfony/var-exporter": "<6.1.1",
+ "phpunit/phpunit": "<9.5",
+ "phpspec/prophecy": "<1.15"
+ },
"description": "Build a fully-featured hypermedia or GraphQL API in minutes!",
- "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-3.4": "3.4.x-dev",
+ "dev-main": "4.0.x-dev"
+ },
+ "symfony": {
+ "require": "^6.4 || ^7.1"
+ },
+ "pmu": {
+ "projects": [
+ "./src/*/composer.json",
+ "src/Doctrine/*/composer.json"
+ ]
+ },
+ "thanks": {
+ "name": "api-platform/api-platform",
+ "url": "https://github.com/api-platform/api-platform"
+ }
+ },
+ "homepage": "https://api-platform.com",
"keywords": [
"REST",
"GraphQL",
@@ -15,15 +74,31 @@
"Symfony",
"Laravel"
],
- "homepage": "https://api-platform.com",
"license": "MIT",
- "authors": [
- {
- "name": "Kévin Dunglas",
- "email": "kevin@dunglas.fr",
- "homepage": "https://dunglas.fr"
- }
- ],
+ "name": "api-platform/core",
+ "replace": {
+ "api-platform/doctrine-common": "self.version",
+ "api-platform/doctrine-odm": "self.version",
+ "api-platform/doctrine-orm": "self.version",
+ "api-platform/documentation": "self.version",
+ "api-platform/elasticsearch": "self.version",
+ "api-platform/graphql": "self.version",
+ "api-platform/http-cache": "self.version",
+ "api-platform/hydra": "self.version",
+ "api-platform/json-api": "self.version",
+ "api-platform/json-hal": "self.version",
+ "api-platform/json-schema": "self.version",
+ "api-platform/jsonld": "self.version",
+ "api-platform/laravel": "self.version",
+ "api-platform/metadata": "self.version",
+ "api-platform/openapi": "self.version",
+ "api-platform/parameter-validator": "self.version",
+ "api-platform/ramsey-uuid": "self.version",
+ "api-platform/serializer": "self.version",
+ "api-platform/state": "self.version",
+ "api-platform/symfony": "self.version",
+ "api-platform/validator": "self.version"
+ },
"require": {
"php": ">=8.2",
"doctrine/inflector": "^1.0 || ^2.0",
@@ -40,24 +115,24 @@
"willdurand/negotiation": "^3.1"
},
"require-dev": {
- "api-platform/json-schema": "^3.4 || ^4.0",
- "api-platform/metadata": "^3.4 || ^4.0",
- "api-platform/state": "^3.4 || ^4.0",
"api-platform/doctrine-common": "^3.4 || ^4.0",
"api-platform/doctrine-odm": "^3.4 || ^4.0",
"api-platform/doctrine-orm": "^3.4 || ^4.0",
+ "api-platform/documentation": "^3.4 || ^4.0",
+ "api-platform/elasticsearch": "^3.4 || ^4.0",
+ "api-platform/graphql": "^3.4 || ^4.0",
+ "api-platform/http-cache": "^3.4 || ^4.0",
+ "api-platform/hydra": "^3.4 || ^4.0",
+ "api-platform/json-api": "^3.3 || ^4.0",
+ "api-platform/json-schema": "^3.4 || ^4.0",
+ "api-platform/jsonld": "^3.4 || ^4.0",
+ "api-platform/metadata": "^3.4 || ^4.0",
"api-platform/openapi": "^3.4 || ^4.0",
"api-platform/ramsey-uuid": "^3.4 || ^4.0",
- "api-platform/jsonld": "^3.4 || ^4.0",
"api-platform/json-hal": "^3.4 || ^4.0",
"api-platform/serializer": "^3.4 || ^4.0",
- "api-platform/json-api": "^3.3 || ^4.0",
- "api-platform/http-cache": "^3.4 || ^4.0",
- "api-platform/elasticsearch": "^3.4 || ^4.0",
- "api-platform/hydra": "^3.4 || ^4.0",
- "api-platform/documentation": "^3.4 || ^4.0",
+ "api-platform/state": "^3.4 || ^4.0",
"api-platform/validator": "^3.4 || ^4.0",
- "api-platform/graphql": "^3.4 || ^4.0",
"behat/behat": "^3.11",
"behat/mink": "^1.9",
"doctrine/cache": "^1.11 || ^2.1",
@@ -130,17 +205,6 @@
"twig/twig": "^1.42.3 || ^2.12 || ^3.0",
"webonyx/graphql-php": "^15.0"
},
- "conflict": {
- "doctrine/common": "<3.2.2",
- "doctrine/dbal": "<2.10",
- "doctrine/orm": "<2.14.0",
- "doctrine/mongodb-odm": "<2.4",
- "doctrine/persistence": "<1.3",
- "symfony/framework-bundle": "6.4.6 || 7.0.6",
- "symfony/var-exporter": "<6.1.1",
- "phpunit/phpunit": "<9.5",
- "phpspec/prophecy": "<1.15"
- },
"suggest": {
"doctrine/mongodb-odm-bundle": "To support MongoDB. Only versions 4.0 and later are supported.",
"elasticsearch/elasticsearch": "To support Elasticsearch.",
@@ -159,46 +223,5 @@
"symfony/web-profiler-bundle": "To use the data collector.",
"webonyx/graphql-php": "To support GraphQL."
},
- "autoload": {
- "psr-4": {
- "ApiPlatform\\": "src/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "ApiPlatform\\Tests\\": "tests/",
- "App\\": "tests/Fixtures/app/var/tmp/src/",
- "Workbench\\App\\": "src/Laravel/workbench/app/",
- "Workbench\\Database\\Factories\\": "src/Laravel/workbench/database/factories/",
- "Workbench\\Database\\Seeders\\": "src/Laravel/workbench/database/seeders/"
- }
- },
- "config": {
- "preferred-install": {
- "*": "dist"
- },
- "sort-packages": true,
- "allow-plugins": {
- "composer/package-versions-deprecated": true,
- "phpstan/extension-installer": true,
- "php-http/discovery": true,
- "soyuka/pmu": true
- }
- },
- "extra": {
- "branch-alias": {
- "dev-3.4": "3.4.x-dev",
- "dev-main": "4.0.x-dev"
- },
- "symfony": {
- "require": "^6.4 || ^7.0"
- },
- "pmu": {
- "projects": ["./src/*/composer.json", "src/Doctrine/*/composer.json"]
- },
- "thanks": {
- "name": "api-platform/api-platform",
- "url": "https://github.com/api-platform/api-platform"
- }
- }
+ "type": "library"
}
diff --git a/src/Doctrine/Common/.gitattributes b/src/Doctrine/Common/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Doctrine/Common/.gitattributes
+++ b/src/Doctrine/Common/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Doctrine/Common/.github/workflows/close_pr.yml b/src/Doctrine/Common/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Doctrine/Common/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Doctrine/Common/README.md b/src/Doctrine/Common/README.md
index b4ad5264133..b06ba7ff330 100644
--- a/src/Doctrine/Common/README.md
+++ b/src/Doctrine/Common/README.md
@@ -1,7 +1,12 @@
-# API Platform - Doctrine Common
+# API Platform - Doctrine Common Support
-Common files used by api-platform/doctrine-orm and api-platform/doctrine-odm
-
-## Resources
+Integration for [Doctrine](https://www.doctrine-project.org) with the [API Platform](https://api-platform.com) framework.
+[Documentation](https://api-platform.com/docs/core/getting-started/)
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Doctrine/Odm/.gitattributes b/src/Doctrine/Odm/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Doctrine/Odm/.gitattributes
+++ b/src/Doctrine/Odm/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Doctrine/Odm/.github/workflows/close_pr.yml b/src/Doctrine/Odm/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Doctrine/Odm/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Doctrine/Odm/README.md b/src/Doctrine/Odm/README.md
new file mode 100644
index 00000000000..020d983f4a4
--- /dev/null
+++ b/src/Doctrine/Odm/README.md
@@ -0,0 +1,12 @@
+# API Platform - Doctrine MongoDB ODM Support
+
+Integration for [Doctrine MongoDB ODM](https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/current/index.html) with the [API Platform](https://api-platform.com) framework.
+
+[Documentation](https://api-platform.com/docs/core/mongodb/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Doctrine/Odm/composer.json b/src/Doctrine/Odm/composer.json
index 59b1988f834..28e302fd5c9 100644
--- a/src/Doctrine/Odm/composer.json
+++ b/src/Doctrine/Odm/composer.json
@@ -28,14 +28,14 @@
"api-platform/doctrine-common": "^3.4 || ^4.0",
"api-platform/metadata": "^3.4 || ^4.0",
"api-platform/state": "^3.4 || ^4.0",
- "doctrine/mongodb-odm": "^2.6",
- "doctrine/mongodb-odm-bundle": "^4.0 || ^5.0",
- "symfony/property-info": "^6.4 || ^7.0"
+ "doctrine/mongodb-odm": "^2.2",
+ "symfony/property-info": "^6.4 || ^7.1"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.11",
- "phpspec/prophecy-phpunit": "^2.2",
- "phpunit/phpunit": "^11.2",
+ "doctrine/mongodb-odm-bundle": "^5.0",
+ "phpspec/prophecy-phpunit": "^2.0",
+ "phpunit/phpunit": "^10.0",
"symfony/cache": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/property-access": "^6.4 || ^7.0",
diff --git a/src/Doctrine/Orm/.gitattributes b/src/Doctrine/Orm/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Doctrine/Orm/.gitattributes
+++ b/src/Doctrine/Orm/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Doctrine/Orm/.github/workflows/close_pr.yml b/src/Doctrine/Orm/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Doctrine/Orm/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Doctrine/Orm/README.md b/src/Doctrine/Orm/README.md
new file mode 100644
index 00000000000..ca9c9ab91b5
--- /dev/null
+++ b/src/Doctrine/Orm/README.md
@@ -0,0 +1,12 @@
+# API Platform - Doctrine ORM Support
+
+Integration for [Doctrine ORM](https://www.doctrine-project.org/projects/doctrine-orm/en/current/index.html) with the [API Platform](https://api-platform.com) framework.
+
+[Documentation](https://api-platform.com/docs/core/getting-started/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Doctrine/Orm/composer.json b/src/Doctrine/Orm/composer.json
index 9bc1aa9ecf5..ff2b513fb42 100644
--- a/src/Doctrine/Orm/composer.json
+++ b/src/Doctrine/Orm/composer.json
@@ -32,9 +32,9 @@
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.11",
- "phpspec/prophecy-phpunit": "^2.2",
- "phpunit/phpunit": "^11.2",
- "ramsey/uuid": "^4.0",
+ "phpspec/prophecy-phpunit": "^2.0",
+ "phpunit/phpunit": "^10.0",
+ "ramsey/uuid": "^4.7",
"ramsey/uuid-doctrine": "^2.0",
"symfony/cache": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
diff --git a/src/Documentation/.gitattributes b/src/Documentation/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Documentation/.gitattributes
+++ b/src/Documentation/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Documentation/.github/workflows/close_pr.yml b/src/Documentation/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Documentation/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Documentation/README.md b/src/Documentation/README.md
new file mode 100644
index 00000000000..c934d777c32
--- /dev/null
+++ b/src/Documentation/README.md
@@ -0,0 +1,12 @@
+# API Platform - Documentation
+
+The API documentation component of the [API Platform](https://api-platform.com) framework.
+
+[Documentation](https://api-platform.com/docs/core/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Elasticsearch/.gitattributes b/src/Elasticsearch/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Elasticsearch/.gitattributes
+++ b/src/Elasticsearch/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Elasticsearch/.github/workflows/close_pr.yml b/src/Elasticsearch/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Elasticsearch/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Elasticsearch/README.md b/src/Elasticsearch/README.md
index 354344479f6..67ad5bc7005 100644
--- a/src/Elasticsearch/README.md
+++ b/src/Elasticsearch/README.md
@@ -1,7 +1,12 @@
-# API Platform - Elasticsearch
+# API Platform - Elasticsearch Support
-Elasticsearch Support.
-
-## Resources
+Integration for [Elasticsearch](https://www.elastic.co/elasticsearch) with the [API Platform](https://api-platform.com) framework.
+[Documentation](https://api-platform.com/docs/core/elasticsearch/)
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/GraphQl/.gitattributes b/src/GraphQl/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/GraphQl/.gitattributes
+++ b/src/GraphQl/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/GraphQl/.github/workflows/close_pr.yml b/src/GraphQl/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/GraphQl/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/GraphQl/Exception/InvalidTypeException.php b/src/GraphQl/Exception/InvalidTypeException.php
new file mode 100644
index 00000000000..31241f627f4
--- /dev/null
+++ b/src/GraphQl/Exception/InvalidTypeException.php
@@ -0,0 +1,18 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace ApiPlatform\GraphQl\Exception;
+
+final class InvalidTypeException extends \RuntimeException
+{
+}
diff --git a/src/GraphQl/README.md b/src/GraphQl/README.md
index 10b0b8c8ae1..f46cd955f55 100644
--- a/src/GraphQl/README.md
+++ b/src/GraphQl/README.md
@@ -1,3 +1,12 @@
# API Platform - GraphQL
-Build GraphQL API endpoints
+The [GraphQL](https://graphql.org/) component of the [API Platform](https://api-platform.com) framework.
+
+[Documentation](https://api-platform.com/docs/core/graphql/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/GraphQl/Type/FieldsBuilder.php b/src/GraphQl/Type/FieldsBuilder.php
index d37562e9280..560ac638670 100644
--- a/src/GraphQl/Type/FieldsBuilder.php
+++ b/src/GraphQl/Type/FieldsBuilder.php
@@ -15,6 +15,7 @@
use ApiPlatform\Doctrine\Odm\State\Options as ODMOptions;
use ApiPlatform\Doctrine\Orm\State\Options;
+use ApiPlatform\GraphQl\Exception\InvalidTypeException;
use ApiPlatform\GraphQl\Resolver\Factory\ResolverFactoryInterface;
use ApiPlatform\GraphQl\Type\Definition\TypeInterface;
use ApiPlatform\Metadata\GraphQl\Mutation;
@@ -35,7 +36,6 @@
use GraphQL\Type\Definition\Type as GraphQLType;
use GraphQL\Type\Definition\WrappingType;
use Psr\Container\ContainerInterface;
-use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
use Symfony\Component\PropertyInfo\Type;
use Symfony\Component\Serializer\NameConverter\AdvancedNameConverterInterface;
use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter;
diff --git a/src/Hal/.github/workflows/close_pr.yml b/src/Hal/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Hal/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Hal/README.md b/src/Hal/README.md
new file mode 100644
index 00000000000..6b74be666ac
--- /dev/null
+++ b/src/Hal/README.md
@@ -0,0 +1,12 @@
+# API Platform - HAL
+
+The [HAL (Hypertext Application Language)](https://stateless.group/hal_specification.html) component of the [API Platform](https://api-platform.com) framework.
+
+[Documentation](https://api-platform.com/docs/core/content-negotiation/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/HttpCache/.github/workflows/close_pr.yml b/src/HttpCache/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/HttpCache/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/HttpCache/README.md b/src/HttpCache/README.md
index f5ebb6814b7..955f70b67cc 100644
--- a/src/HttpCache/README.md
+++ b/src/HttpCache/README.md
@@ -1,7 +1,15 @@
# API Platform - HTTP Cache
-HTTP Cache support.
+The [HTTP Cache](https://httpwg.org/specs/rfc7234.html) component of the [API Platform](https://api-platform.com) framework.
-## Resources
+This component also provides integrations with [Varnish](https://varnish-cache.org/), [Souin](https://souin.io/)
+and other HTTP cache servers and services.
+[Documentation](https://api-platform.com/docs/core/performance/)
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Hydra/.gitattributes b/src/Hydra/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Hydra/.gitattributes
+++ b/src/Hydra/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Hydra/.github/workflows/close_pr.yml b/src/Hydra/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Hydra/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Hydra/README.md b/src/Hydra/README.md
new file mode 100644
index 00000000000..73453153077
--- /dev/null
+++ b/src/Hydra/README.md
@@ -0,0 +1,14 @@
+# API Platform - Hydra
+
+The [Hydra](https://www.hydra-cg.com/) component of the [API Platform](https://api-platform.com) framework.
+
+Hydra simplifies the development of interoperable, hypermedia-driven Web APIs.
+
+[Documentation](https://api-platform.com/docs/core/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/JsonApi/.gitattributes b/src/JsonApi/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/JsonApi/.gitattributes
+++ b/src/JsonApi/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/JsonApi/.github/workflows/close_pr.yml b/src/JsonApi/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/JsonApi/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/JsonApi/README.md b/src/JsonApi/README.md
new file mode 100644
index 00000000000..ab44d8430f7
--- /dev/null
+++ b/src/JsonApi/README.md
@@ -0,0 +1,14 @@
+# API Platform - JSON:API
+
+The [JSON:API](https://jsonapi.org/) component of the [API Platform](https://api-platform.com) framework.
+
+JSON:API is a popular specification for building APIs in JSON.
+
+[Documentation](https://api-platform.com/docs/core/content-negotiation/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/JsonLd/.gitattributes b/src/JsonLd/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/JsonLd/.gitattributes
+++ b/src/JsonLd/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/JsonLd/.github/workflows/close_pr.yml b/src/JsonLd/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/JsonLd/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/JsonLd/README.md b/src/JsonLd/README.md
new file mode 100644
index 00000000000..2e243daa495
--- /dev/null
+++ b/src/JsonLd/README.md
@@ -0,0 +1,14 @@
+# API Platform - JSON-LD
+
+The [JSON-LD](https://json-ld.org/) component of the [API Platform](https://api-platform.com) framework.
+
+Data is messy and disconnected. JSON-LD organizes and connects it, creating a better Web.
+
+[Documentation](https://api-platform.com/docs/core/extending-jsonld-context/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/JsonSchema/.gitattributes b/src/JsonSchema/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/JsonSchema/.gitattributes
+++ b/src/JsonSchema/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/JsonSchema/.github/workflows/close_pr.yml b/src/JsonSchema/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/JsonSchema/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/JsonSchema/README.md b/src/JsonSchema/README.md
index 45d4d62fb65..7ddde68af18 100644
--- a/src/JsonSchema/README.md
+++ b/src/JsonSchema/README.md
@@ -1,7 +1,14 @@
# API Platform - JSON Schema
-Build a JSON Schema from API Resources.
+The [JSON Schema](https://json-schema.org/) component of the [API Platform](https://api-platform.com) framework.
-## Resources
+Generates JSON Schema from PHP classes.
+[Documentation](https://api-platform.com/docs/core/json-schema/)
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Laravel/Eloquent/State/PersistProcessor.php b/src/Laravel/Eloquent/State/PersistProcessor.php
index 6f61b039540..84a01ce661d 100644
--- a/src/Laravel/Eloquent/State/PersistProcessor.php
+++ b/src/Laravel/Eloquent/State/PersistProcessor.php
@@ -14,6 +14,7 @@
namespace ApiPlatform\Laravel\Eloquent\State;
use ApiPlatform\Laravel\Eloquent\Metadata\ModelMetadata;
+use ApiPlatform\Metadata\HttpOperation;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProcessorInterface;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -41,6 +42,15 @@ public function process(mixed $data, Operation $operation, array $uriVariables =
}
}
+ if (($previousData = $context['previous_data'] ?? null) && $operation instanceof HttpOperation && 'PUT' === $operation->getMethod() && ($operation->getExtraProperties()['standard_put'] ?? true)) {
+ foreach ($this->modelMetadata->getAttributes($data) as $attribute) {
+ if ($attribute['primary'] ?? false) {
+ $data->{$attribute['name']} = $previousData->{$attribute['name']};
+ }
+ }
+ $data->exists = true;
+ }
+
$data->saveOrFail();
$data->refresh();
diff --git a/src/Laravel/Tests/JsonLdTest.php b/src/Laravel/Tests/JsonLdTest.php
index 44a87cbec4e..4a4363b7111 100644
--- a/src/Laravel/Tests/JsonLdTest.php
+++ b/src/Laravel/Tests/JsonLdTest.php
@@ -97,7 +97,6 @@ public function testUpdateBook(): void
);
$response->assertStatus(200);
$response->assertJsonFragment([
- '@id' => $iri,
'name' => 'updated title',
]);
}
diff --git a/src/Metadata/.gitattributes b/src/Metadata/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Metadata/.gitattributes
+++ b/src/Metadata/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Metadata/.github/workflows/close_pr.yml b/src/Metadata/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Metadata/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Metadata/README.md b/src/Metadata/README.md
new file mode 100644
index 00000000000..f55db2da66b
--- /dev/null
+++ b/src/Metadata/README.md
@@ -0,0 +1,14 @@
+# API Platform - Metadata
+
+The Metadata component of the [API Platform](https://api-platform.com) framework.
+
+Generates abstract representation of web APIs. It's the core of the API Platform Core library.
+
+[Documentation](https://api-platform.com/docs/core/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/OpenApi/.gitattributes b/src/OpenApi/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/OpenApi/.gitattributes
+++ b/src/OpenApi/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/OpenApi/.github/workflows/close_pr.yml b/src/OpenApi/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/OpenApi/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/OpenApi/README.md b/src/OpenApi/README.md
index 8515317fd3d..fe8dcbe6539 100644
--- a/src/OpenApi/README.md
+++ b/src/OpenApi/README.md
@@ -1,8 +1,14 @@
# API Platform - OpenAPI
-Models to build and serialize an OpenAPI specification.
+The [OpenAPI](https://www.openapis.org) component of the [API Platform](https://api-platform.com) framework.
-## Resources
+Builds and serializes OpenAPI specifications. OpenAPI was formerly known as Swagger.
-- [Documentation](https://api-platform.com/docs)
-- [Report issues](https://github.com/api-platform/core/issues) and [send Pull Requests](https://github.com/api-platform/core/pulls) on the [main API Platform repository](https://github.com/api-platform/core)
+[Documentation](https://api-platform.com/docs/core/openapi/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/OpenApi/Serializer/SerializerContextBuilder.php b/src/OpenApi/Serializer/SerializerContextBuilder.php
index a7244a3a6fe..afb48243639 100644
--- a/src/OpenApi/Serializer/SerializerContextBuilder.php
+++ b/src/OpenApi/Serializer/SerializerContextBuilder.php
@@ -13,14 +13,13 @@
namespace ApiPlatform\OpenApi\Serializer;
-use ApiPlatform\Serializer\SerializerContextBuilderInterface as LegacySerializerContextBuilderInterface;
use ApiPlatform\State\SerializerContextBuilderInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* @internal
*/
-final class SerializerContextBuilder implements SerializerContextBuilderInterface, LegacySerializerContextBuilderInterface
+final class SerializerContextBuilder implements SerializerContextBuilderInterface
{
public function __construct(private readonly SerializerContextBuilderInterface $decorated)
{
diff --git a/src/ParameterValidator/.github/workflows/close_pr.yml b/src/ParameterValidator/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/ParameterValidator/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/RamseyUuid/.gitattributes b/src/RamseyUuid/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/RamseyUuid/.gitattributes
+++ b/src/RamseyUuid/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/RamseyUuid/.github/workflows/close_pr.yml b/src/RamseyUuid/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/RamseyUuid/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/RamseyUuid/README.md b/src/RamseyUuid/README.md
index a3540188e79..808b9a65260 100644
--- a/src/RamseyUuid/README.md
+++ b/src/RamseyUuid/README.md
@@ -1,3 +1,12 @@
-# API Platform - RamseyUuid
+# API Platform - `ramsey/uuid
-RamseyUuid component from API Platform
+Integration for [`ramsey/uuid`](https://uuid.ramsey.dev) with the [API Platform](https://api-platform.com) framework.
+
+[Documentation](https://api-platform.com/docs/core/identifiers/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Serializer/.gitattributes b/src/Serializer/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Serializer/.gitattributes
+++ b/src/Serializer/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Serializer/.github/workflows/close_pr.yml b/src/Serializer/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Serializer/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Serializer/README.md b/src/Serializer/README.md
index 10b0b8c8ae1..9d86f6867cb 100644
--- a/src/Serializer/README.md
+++ b/src/Serializer/README.md
@@ -1,3 +1,15 @@
-# API Platform - GraphQL
+# API Platform - Serializer
-Build GraphQL API endpoints
+The Serializer component of the [API Platform](https://api-platform.com) framework.
+
+Serializes PHP objects in various API formats.
+Built on top of the Symfony Serializer component.
+
+[Documentation](https://api-platform.com/docs/core/serialization/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Serializer/SerializerContextBuilder.php b/src/Serializer/SerializerContextBuilder.php
index f9aa34c1bf1..1393a3c07b8 100644
--- a/src/Serializer/SerializerContextBuilder.php
+++ b/src/Serializer/SerializerContextBuilder.php
@@ -19,6 +19,7 @@
use ApiPlatform\Metadata\Exception\RuntimeException;
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
use ApiPlatform\Metadata\Util\AttributesExtractor;
+use ApiPlatform\State\SerializerContextBuilderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Serializer\Encoder\CsvEncoder;
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
diff --git a/src/Serializer/SerializerContextBuilderInterface.php b/src/Serializer/SerializerContextBuilderInterface.php
deleted file mode 100644
index dbae714fd7d..00000000000
--- a/src/Serializer/SerializerContextBuilderInterface.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-declare(strict_types=1);
-
-namespace ApiPlatform\Serializer;
-
-use ApiPlatform\State\SerializerContextBuilderInterface as StateSerializerContextBuilderInterface;
-
-/**
- * Builds the context used by the Symfony Serializer.
- *
- * @deprecated use ApiPlatform\State\SerializerContextBuilderInterface instead
- *
- * @author Kévin Dunglas
- */
-interface SerializerContextBuilderInterface extends StateSerializerContextBuilderInterface
-{
-}
diff --git a/src/Serializer/SerializerFilterContextBuilder.php b/src/Serializer/SerializerFilterContextBuilder.php
index 9073bbe1136..3cf9cb5894b 100644
--- a/src/Serializer/SerializerFilterContextBuilder.php
+++ b/src/Serializer/SerializerFilterContextBuilder.php
@@ -17,7 +17,7 @@
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
use ApiPlatform\Metadata\Util\AttributesExtractor;
use ApiPlatform\Serializer\Filter\FilterInterface;
-use ApiPlatform\State\SerializerContextBuilderInterface as StateSerializerContextBuilderInterface;
+use ApiPlatform\State\SerializerContextBuilderInterface;
use Psr\Container\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -28,7 +28,7 @@
*/
final class SerializerFilterContextBuilder implements SerializerContextBuilderInterface
{
- public function __construct(private readonly ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, private readonly ContainerInterface $filterLocator, private readonly SerializerContextBuilderInterface|StateSerializerContextBuilderInterface $decorated)
+ public function __construct(private readonly ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, private readonly ContainerInterface $filterLocator, private readonly SerializerContextBuilderInterface $decorated)
{
}
diff --git a/src/Serializer/Tests/SerializerFilterContextBuilderTest.php b/src/Serializer/Tests/SerializerFilterContextBuilderTest.php
index a06b8ce34f7..41b7da79a94 100644
--- a/src/Serializer/Tests/SerializerFilterContextBuilderTest.php
+++ b/src/Serializer/Tests/SerializerFilterContextBuilderTest.php
@@ -20,9 +20,9 @@
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
use ApiPlatform\Serializer\Filter\FilterInterface as SerializerFilterInterface;
-use ApiPlatform\Serializer\SerializerContextBuilderInterface;
use ApiPlatform\Serializer\SerializerFilterContextBuilder;
use ApiPlatform\Serializer\Tests\Fixtures\ApiResource\DummyGroup;
+use ApiPlatform\State\SerializerContextBuilderInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;
diff --git a/src/Serializer/composer.json b/src/Serializer/composer.json
index 361fb2eea34..04059f3db6b 100644
--- a/src/Serializer/composer.json
+++ b/src/Serializer/composer.json
@@ -25,26 +25,28 @@
"php": ">=8.2",
"api-platform/metadata": "^3.4 || ^4.0",
"api-platform/state": "^3.4 || ^4.0",
- "doctrine/collections": "^2.1",
"symfony/property-access": "^6.4 || ^7.0",
"symfony/property-info": "^6.4 || ^7.0",
"symfony/serializer": "^6.4 || ^7.0",
"symfony/validator": "^6.4 || ^7.0"
},
"require-dev": {
- "api-platform/openapi": "^3.4 || ^4.0",
+ "api-platform/doctrine-common": "^3.4 || ^4.0",
+ "api-platform/doctrine-odm": "^3.4 || ^4.0",
+ "api-platform/doctrine-orm": "^3.4 || ^4.0",
"api-platform/json-schema": "^3.4 || ^4.0",
+ "api-platform/openapi": "^3.4 || ^4.0",
+ "doctrine/collections": "^2.1",
"phpspec/prophecy-phpunit": "^2.2",
+ "phpunit/phpunit": "^11.2",
+ "sebastian/comparator": "<5.0",
"symfony/mercure-bundle": "*",
"symfony/var-dumper": "^6.4 || ^7.0",
- "phpunit/phpunit": "^11.2",
- "symfony/yaml": "^6.4 || ^7.0",
- "api-platform/doctrine-odm": "^3.4 || ^4.0",
- "api-platform/doctrine-orm": "^3.4 || ^4.0",
- "api-platform/doctrine-common": "^3.4 || ^4.0"
+ "symfony/yaml": "^6.4 || ^7.0"
},
"suggest": {
- "api-platform/doctrine-orm": "To support doctrine ORM state options."
+ "api-platform/doctrine-orm": "To support Doctrine ORM state options.",
+ "api-platform/doctrine-odm": "To support Doctrine MongoDB ODM state options."
},
"autoload": {
"psr-4": {
diff --git a/src/State/.gitattributes b/src/State/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/State/.gitattributes
+++ b/src/State/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/State/.github/workflows/close_pr.yml b/src/State/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/State/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/State/Provider/DeserializeProvider.php b/src/State/Provider/DeserializeProvider.php
index db735e19961..be399f4f1bf 100644
--- a/src/State/Provider/DeserializeProvider.php
+++ b/src/State/Provider/DeserializeProvider.php
@@ -15,7 +15,6 @@
use ApiPlatform\Metadata\HttpOperation;
use ApiPlatform\Metadata\Operation;
-use ApiPlatform\Serializer\SerializerContextBuilderInterface as LegacySerializerContextBuilderInterface;
use ApiPlatform\State\ProviderInterface;
use ApiPlatform\State\SerializerContextBuilderInterface;
use ApiPlatform\Validator\Exception\ValidationException;
@@ -36,7 +35,7 @@ final class DeserializeProvider implements ProviderInterface
public function __construct(
private readonly ?ProviderInterface $decorated,
private readonly SerializerInterface $serializer,
- private readonly LegacySerializerContextBuilderInterface|SerializerContextBuilderInterface $serializerContextBuilder,
+ private readonly SerializerContextBuilderInterface $serializerContextBuilder,
private ?TranslatorInterface $translator = null,
) {
if (null === $this->translator) {
diff --git a/src/State/README.md b/src/State/README.md
new file mode 100644
index 00000000000..f0e4b1b96ef
--- /dev/null
+++ b/src/State/README.md
@@ -0,0 +1,17 @@
+# API Platform - Serializer
+
+The State component of the [API Platform](https://api-platform.com) framework.
+
+Provides and processes API states.
+
+Documentation:
+
+* [State providers](https://api-platform.com/docs/core/state-providers/)
+* [State processors](https://api-platform.com/docs/core/state-processors/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Symfony/.gitattributes b/src/Symfony/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Symfony/.gitattributes
+++ b/src/Symfony/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Symfony/.github/workflows/close_pr.yml b/src/Symfony/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Symfony/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Symfony/Bundle/Resources/config/api.xml b/src/Symfony/Bundle/Resources/config/api.xml
index 0605eb4ff37..275bef9278d 100644
--- a/src/Symfony/Bundle/Resources/config/api.xml
+++ b/src/Symfony/Bundle/Resources/config/api.xml
@@ -38,7 +38,7 @@
-
+
@@ -85,8 +85,8 @@
-
-
+
+
diff --git a/src/Symfony/README.md b/src/Symfony/README.md
index d29d4d76f66..96d05e0d4ca 100644
--- a/src/Symfony/README.md
+++ b/src/Symfony/README.md
@@ -1,3 +1,12 @@
-# Symfony Integration of API Platform
+# API Platform for Symfony
-Integrates [API Platform](https://api-platform.com) into the [Symfony](https://symfony.com) framework and components.
+Integration of [Symfony](https://symfony.com) with the [API Platform](https://api-platform.com) framework.
+
+[Documentation](https://api-platform.com/docs/symfony/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php b/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php
index 706052dda5c..2a2fe0f197c 100644
--- a/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php
+++ b/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php
@@ -21,9 +21,9 @@
use ApiPlatform\Metadata\UrlGeneratorInterface;
use ApiPlatform\Serializer\Filter\GroupFilter;
use ApiPlatform\Serializer\Filter\PropertyFilter;
-use ApiPlatform\Serializer\SerializerContextBuilderInterface;
use ApiPlatform\State\Pagination\Pagination;
use ApiPlatform\State\Pagination\PaginationOptions;
+use ApiPlatform\State\SerializerContextBuilderInterface;
use ApiPlatform\Symfony\Action\NotFoundAction;
use ApiPlatform\Symfony\Bundle\DependencyInjection\ApiPlatformExtension;
use ApiPlatform\Tests\Fixtures\TestBundle\TestBundle;
diff --git a/src/Validator/.gitattributes b/src/Validator/.gitattributes
index ae3c2e1685a..801f2080d71 100644
--- a/src/Validator/.gitattributes
+++ b/src/Validator/.gitattributes
@@ -1,2 +1,5 @@
+/.github export-ignore
+/.gitattributes export-ignore
/.gitignore export-ignore
/Tests export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/src/Validator/.github/workflows/close_pr.yml b/src/Validator/.github/workflows/close_pr.yml
new file mode 100644
index 00000000000..72a8ab4325e
--- /dev/null
+++ b/src/Validator/.github/workflows/close_pr.yml
@@ -0,0 +1,13 @@
+name: Close Pull Request
+
+on:
+ pull_request_target:
+ types: [opened]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.
Thanks!"
diff --git a/src/Validator/README.md b/src/Validator/README.md
index 61b275cec98..0fd07a936e3 100644
--- a/src/Validator/README.md
+++ b/src/Validator/README.md
@@ -1,3 +1,12 @@
# API Platform - Validator
-Validator component from API Platform
+The Validator component of the [API Platform](https://api-platform.com) framework.
+
+[Documentation](https://api-platform.com/docs/admin/validation/)
+
+> [!CAUTION]
+>
+> This is a read-only sub split of `api-platform/core`, please
+> [report issues](https://github.com/api-platform/core/issues) and
+> [send Pull Requests](https://github.com/api-platform/core/pulls)
+> in the [core API Platform repository](https://github.com/api-platform/core).
diff --git a/tests/Symfony/Bundle/ArgumentResolver/PayloadArgumentResolverTest.php b/tests/Symfony/Bundle/ArgumentResolver/PayloadArgumentResolverTest.php
index b5c6a47322a..786a9c584f8 100644
--- a/tests/Symfony/Bundle/ArgumentResolver/PayloadArgumentResolverTest.php
+++ b/tests/Symfony/Bundle/ArgumentResolver/PayloadArgumentResolverTest.php
@@ -19,7 +19,7 @@
use ApiPlatform\Metadata\Put;
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
-use ApiPlatform\Serializer\SerializerContextBuilderInterface;
+use ApiPlatform\State\SerializerContextBuilderInterface;
use ApiPlatform\Symfony\Bundle\ArgumentResolver\PayloadArgumentResolver;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\ResourceImplementation;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\ResourceInterface;