Skip to content

Merge 4.1 #7176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
May 26, 2025
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
efd00d1
chore(hydra)!: remove 3.4 deprecation (#7155)
maxhelias May 19, 2025
5459ba3
fix(metadata): parameter cast to array flag (#7160)
soyuka May 20, 2025
329acf2
fix(metadata): infer parameter string type from schema (#7161)
soyuka May 20, 2025
4d66f5e
fix(laravel): persist embeded relations with groups
soyuka May 21, 2025
767fa92
feat(laravel): add name_converter option
Seb33300 May 20, 2025
61301d9
test(laravel): test to change the name converter
soyuka May 21, 2025
fe73002
fix(laravel): duplicated property names
soyuka May 21, 2025
4e7e861
chore(laravel): comments on name converter
soyuka May 21, 2025
730d17a
fix(laravel): validate the model instead of body
soyuka May 22, 2025
b039008
fix(laravel): name convert validation property path
soyuka May 22, 2025
bf166bb
test(laravel): validation tests #6932
soyuka May 22, 2025
fd010ea
fix(openapi): nullable externalDocs return type
soyuka May 22, 2025
470c2e8
fix(httpcache): iri cache tag for collection operation with path par…
JakovKnezovicc May 22, 2025
9c0dbb6
fix(state): do not expose FQCN in DeserializeProvider on PartialDenor…
alexndlm May 22, 2025
937443d
chore: httpcache in commitlint configuration
soyuka May 22, 2025
f789860
fix(serializer): exception message to not expose resource FQCN (#7156)
alexndlm May 22, 2025
3912394
fix(laravel): register error handler without graphql
soyuka May 22, 2025
383ac88
docs: changelog 4.1.10
soyuka May 22, 2025
e7b3df1
fix(laravel): register error handler without graphql (#7168)
soyuka May 22, 2025
30f8bcc
chore: bump patch dependencies
soyuka May 22, 2025
c5e959d
docs: changelog 4.1.11
soyuka May 22, 2025
b14a463
fix(laravel): register error handler without graphql
soyuka May 22, 2025
abb1fac
docs: changelog 4.1.12
soyuka May 22, 2025
d4a053e
Merge 4.1
soyuka May 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
"elasticsearch",
"mongodb",
"jsonld",
"httpcache",
"hydra",
"httpcache",
"jsonapi",
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## v4.1.11 - v4.1.12

### Bug fixes

* [b14a463a9](https://github.com/api-platform/core/commit/b14a463a9da8a285eba1b0adc63ca4121efb0dce) fix(laravel): register error handler without graphql

## v4.1.10

### Bug fixes

* [329acf21e](https://github.com/api-platform/core/commit/329acf21e3a8618136a21b9121c5891f1fe6b9e8) fix(metadata): infer parameter string type from schema (#7161)
* [5459ba375](https://github.com/api-platform/core/commit/5459ba375b0e7ffd1c783a6e18a6452769eaff46) fix(metadata): parameter cast to array flag (#7160)
* [fe73002bf](https://github.com/api-platform/core/commit/fe73002bf5ae64adb1eb9e310dc62ff158de094d) fix(laravel): duplicated property names
* [b0390080e](https://github.com/api-platform/core/commit/b0390080e90be9ac494c8b4d968e59a4962f32ca) fix(laravel): name convert validation property path
* [730d17a30](https://github.com/api-platform/core/commit/730d17a306df4b92082484a19e82c5e150537331) fix(laravel): validate the model instead of body
* [4d66f5ef3](https://github.com/api-platform/core/commit/4d66f5ef313fe3857611e8345702a10019c79ec5) fix(laravel): persist embeded relations with groups
* [39123942a](https://github.com/api-platform/core/commit/39123942a0e1ff9dfb1e46f4a410160e3cd3fbd7) fix(laravel): register error handler without graphql
* [fd010ea1b](https://github.com/api-platform/core/commit/fd010ea1be86073f5d8905d5640846390ade7ce6) fix(openapi): nullable externalDocs return type
* [470c2e8bd](https://github.com/api-platform/core/commit/470c2e8bdf8d7a7502c02d2b681ced2001e2c1cc) fix(httpcache): iri cache tag for collection operation with path parameter
* [9c0dbb653](https://github.com/api-platform/core/commit/9c0dbb65319beb89193e653e14c99352ac529a55) fix(state): do not expose FQCN in DeserializeProvider on PartialDenormalizationException (#7158)
* [f78986000](https://github.com/api-platform/core/commit/f789860009888582791611a31d6084c620050615) fix(serializer): exception message to not expose resource FQCN (#7156)

### Features

* [767fa926b](https://github.com/api-platform/core/commit/767fa926b10bef771e896300b8e796287392d8c0) feat(laravel): add name_converter option

## v4.1.9

### Bug fixes
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@
"ramsey/uuid": "^4.7",
"ramsey/uuid-doctrine": "^2.0",
"soyuka/contexts": "^3.3.10",
"soyuka/pmu": "^0.1.0",
"soyuka/pmu": "^0.2.0",
"soyuka/stubs-mongodb": "^1.0",
"symfony/asset": "^6.4 || ^7.0",
"symfony/browser-kit": "^6.4 || ^7.0",
4 changes: 2 additions & 2 deletions src/Doctrine/Common/composer.json
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@
],
"require": {
"php": ">=8.2",
"api-platform/metadata": "^4.1",
"api-platform/state": "^4.1.8",
"api-platform/metadata": "^4.1.11",
"api-platform/state": "^4.1.11",
"doctrine/collections": "^2.1",
"doctrine/common": "^3.2.2",
"doctrine/persistence": "^3.2"
6 changes: 3 additions & 3 deletions src/Doctrine/Odm/composer.json
Original file line number Diff line number Diff line change
@@ -25,9 +25,9 @@
],
"require": {
"php": ">=8.2",
"api-platform/doctrine-common": "^4.1",
"api-platform/metadata": "^4.1",
"api-platform/state": "^4.1.8",
"api-platform/doctrine-common": "^4.1.11",
"api-platform/metadata": "^4.1.11",
"api-platform/state": "^4.1.11",
"doctrine/mongodb-odm": "^2.10",
"symfony/property-info": "^6.4 || ^7.1",
"symfony/type-info": "v7.3.0-BETA1"
6 changes: 3 additions & 3 deletions src/Doctrine/Orm/composer.json
Original file line number Diff line number Diff line change
@@ -24,9 +24,9 @@
],
"require": {
"php": ">=8.2",
"api-platform/doctrine-common": "^4.1",
"api-platform/metadata": "^4.1",
"api-platform/state": "^4.1.8",
"api-platform/doctrine-common": "^4.1.11",
"api-platform/metadata": "^4.1.11",
"api-platform/state": "^4.1.11",
"doctrine/orm": "^2.17 || ^3.0",
"symfony/property-info": "^6.4 || ^7.1"
},
2 changes: 1 addition & 1 deletion src/Documentation/composer.json
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
],
"require": {
"php": ">=8.2",
"api-platform/metadata": "^4.1"
"api-platform/metadata": "^4.1.11"
},
"extra": {
"branch-alias": {
6 changes: 3 additions & 3 deletions src/Elasticsearch/composer.json
Original file line number Diff line number Diff line change
@@ -24,9 +24,9 @@
],
"require": {
"php": ">=8.2",
"api-platform/metadata": "^4.1",
"api-platform/serializer": "^4.1",
"api-platform/state": "^4.1",
"api-platform/metadata": "^4.1.11",
"api-platform/serializer": "^4.1.11",
"api-platform/state": "^4.1.11",
"elasticsearch/elasticsearch": "^7.17 || ^8.4",
"symfony/cache": "^6.4 || ^7.0",
"symfony/console": "^6.4 || ^7.0",
6 changes: 3 additions & 3 deletions src/GraphQl/composer.json
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@
],
"require": {
"php": ">=8.2",
"api-platform/metadata": "^4.1",
"api-platform/state": "^4.1",
"api-platform/serializer": "^4.1",
"api-platform/metadata": "^4.1.11",
"api-platform/state": "^4.1.11",
"api-platform/serializer": "^4.1.11",
"symfony/property-info": "^6.4 || ^7.1",
"symfony/serializer": "^6.4 || ^7.0",
"symfony/type-info": "v7.3.0-BETA1",
6 changes: 3 additions & 3 deletions src/Hal/composer.json
Original file line number Diff line number Diff line change
@@ -22,9 +22,9 @@
],
"require": {
"php": ">=8.2",
"api-platform/state": "^4.1",
"api-platform/metadata": "^4.1",
"api-platform/serializer": "^3.4 || ^4.0",
"api-platform/state": "^4.1.11",
"api-platform/metadata": "^4.1.11",
"api-platform/serializer": "^4.1.11",
"symfony/type-info": "v7.3.0-BETA1"
},
"autoload": {
4 changes: 2 additions & 2 deletions src/HttpCache/composer.json
Original file line number Diff line number Diff line change
@@ -23,8 +23,8 @@
],
"require": {
"php": ">=8.2",
"api-platform/metadata": "^4.1",
"api-platform/state": "^4.1",
"api-platform/metadata": "^4.1.11",
"api-platform/state": "^4.1.11",
"symfony/http-foundation": "^6.4 || ^7.0"
},
"require-dev": {
7 changes: 1 addition & 6 deletions src/Hydra/Serializer/CollectionNormalizer.php
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
use ApiPlatform\JsonLd\Serializer\HydraPrefixTrait;
use ApiPlatform\JsonLd\Serializer\JsonLdContextTrait;
use ApiPlatform\Metadata\IriConverterInterface;
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
use ApiPlatform\Metadata\ResourceClassResolverInterface;
use ApiPlatform\Metadata\UrlGeneratorInterface;
use ApiPlatform\Serializer\AbstractCollectionNormalizer;
@@ -41,14 +40,10 @@ final class CollectionNormalizer extends AbstractCollectionNormalizer
self::IRI_ONLY => false,
];

public function __construct(private readonly ContextBuilderInterface $contextBuilder, ResourceClassResolverInterface $resourceClassResolver, private readonly IriConverterInterface $iriConverter, readonly ?ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null, array $defaultContext = [])
public function __construct(private readonly ContextBuilderInterface $contextBuilder, ResourceClassResolverInterface $resourceClassResolver, private readonly IriConverterInterface $iriConverter, array $defaultContext = [])
{
$this->defaultContext = array_merge($this->defaultContext, $defaultContext);

if ($resourceMetadataCollectionFactory) {
trigger_deprecation('api-platform/core', '3.0', \sprintf('Injecting "%s" within "%s" is not needed anymore and this dependency will be removed in 4.0.', ResourceMetadataCollectionFactoryInterface::class, self::class));
}

parent::__construct($resourceClassResolver, '');
}

10 changes: 5 additions & 5 deletions src/JsonApi/composer.json
Original file line number Diff line number Diff line change
@@ -22,11 +22,11 @@
],
"require": {
"php": ">=8.2",
"api-platform/documentation": "^4.1",
"api-platform/json-schema": "^4.1",
"api-platform/metadata": "^4.1",
"api-platform/serializer": "^4.1",
"api-platform/state": "^4.1",
"api-platform/documentation": "^4.1.11",
"api-platform/json-schema": "^4.1.11",
"api-platform/metadata": "^4.1.11",
"api-platform/serializer": "^4.1.11",
"api-platform/state": "^4.1.11",
"symfony/error-handler": "^6.4 || ^7.0",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/type-info": "v7.3.0-BETA1"
6 changes: 3 additions & 3 deletions src/JsonLd/composer.json
Original file line number Diff line number Diff line change
@@ -24,9 +24,9 @@
],
"require": {
"php": ">=8.2",
"api-platform/state": "^4.1",
"api-platform/metadata": "^4.1",
"api-platform/serializer": "^4.1"
"api-platform/state": "^4.1.11",
"api-platform/metadata": "^4.1.11",
"api-platform/serializer": "^4.1.11"
},
"autoload": {
"psr-4": {
2 changes: 1 addition & 1 deletion src/JsonSchema/composer.json
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
],
"require": {
"php": ">=8.2",
"api-platform/metadata": "^4.1",
"api-platform/metadata": "^4.1.11",
"symfony/console": "^6.4 || ^7.0",
"symfony/property-info": "^6.4 || ^7.1",
"symfony/serializer": "^6.4 || ^7.0",
30 changes: 28 additions & 2 deletions src/Laravel/ApiPlatformDeferredProvider.php
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
use ApiPlatform\GraphQl\Type\TypesContainerInterface;
use ApiPlatform\JsonApi\Filter\SparseFieldset;
use ApiPlatform\JsonApi\Filter\SparseFieldsetParameterProvider;
use ApiPlatform\Laravel\Controller\ApiPlatformController;
use ApiPlatform\Laravel\Eloquent\Extension\FilterQueryExtension;
use ApiPlatform\Laravel\Eloquent\Extension\QueryExtensionInterface;
use ApiPlatform\Laravel\Eloquent\Filter\BooleanFilter;
@@ -42,10 +43,13 @@
use ApiPlatform\Laravel\Eloquent\State\LinksHandlerInterface;
use ApiPlatform\Laravel\Eloquent\State\PersistProcessor;
use ApiPlatform\Laravel\Eloquent\State\RemoveProcessor;
use ApiPlatform\Laravel\Exception\ErrorHandler;
use ApiPlatform\Laravel\Metadata\CacheResourceCollectionMetadataFactory;
use ApiPlatform\Laravel\Metadata\ParameterValidationResourceMetadataCollectionFactory;
use ApiPlatform\Laravel\State\ParameterValidatorProvider;
use ApiPlatform\Laravel\State\SwaggerUiProcessor;
use ApiPlatform\Laravel\State\ValidateProvider;
use ApiPlatform\Metadata\IdentifiersExtractorInterface;
use ApiPlatform\Metadata\InflectorInterface;
use ApiPlatform\Metadata\Operation\PathSegmentNameGeneratorInterface;
use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
@@ -76,13 +80,14 @@
use ApiPlatform\State\Pagination\Pagination;
use ApiPlatform\State\ParameterProviderInterface;
use ApiPlatform\State\ProcessorInterface;
use ApiPlatform\State\Provider\DeserializeProvider;
use ApiPlatform\State\Provider\ParameterProvider;
use ApiPlatform\State\Provider\SecurityParameterProvider;
use ApiPlatform\State\ProviderInterface;
use Illuminate\Contracts\Debug\ExceptionHandler as ExceptionHandlerInterface;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
use Negotiation\Negotiator;
use Psr\Log\LoggerInterface;
use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
@@ -133,7 +138,7 @@
return new ParameterProvider(
new ParameterValidatorProvider(
new SecurityParameterProvider(
$app->make(DeserializeProvider::class),
$app->make(ValidateProvider::class),

Check warning on line 141 in src/Laravel/ApiPlatformDeferredProvider.php

Codecov / codecov/patch

src/Laravel/ApiPlatformDeferredProvider.php#L141

Added line #L141 was not covered by tests
$app->make(ResourceAccessCheckerInterface::class)
),
),
@@ -247,6 +252,26 @@
);
});

$this->app->singleton(
ExceptionHandlerInterface::class,
function (Application $app) {

Check warning on line 257 in src/Laravel/ApiPlatformDeferredProvider.php

Codecov / codecov/patch

src/Laravel/ApiPlatformDeferredProvider.php#L255-L257

Added lines #L255 - L257 were not covered by tests
/** @var ConfigRepository */
$config = $app['config'];

Check warning on line 259 in src/Laravel/ApiPlatformDeferredProvider.php

Codecov / codecov/patch

src/Laravel/ApiPlatformDeferredProvider.php#L259

Added line #L259 was not covered by tests

return new ErrorHandler(
$app,
$app->make(ResourceMetadataCollectionFactoryInterface::class),
$app->make(ApiPlatformController::class),
$app->make(IdentifiersExtractorInterface::class),
$app->make(ResourceClassResolverInterface::class),
$app->make(Negotiator::class),
$config->get('api-platform.exception_to_status'),
$config->get('app.debug'),
$config->get('api-platform.error_formats')
);
}
);

Check warning on line 273 in src/Laravel/ApiPlatformDeferredProvider.php

Codecov / codecov/patch

src/Laravel/ApiPlatformDeferredProvider.php#L261-L273

Added lines #L261 - L273 were not covered by tests

if (interface_exists(FieldsBuilderEnumInterface::class)) {
$this->registerGraphQl();
}
@@ -329,6 +354,7 @@
ResourceMetadataCollectionFactoryInterface::class,
'api_platform.graphql.state_provider.parameter',
FieldsBuilderEnumInterface::class,
ExceptionHandlerInterface::class,

Check warning on line 357 in src/Laravel/ApiPlatformDeferredProvider.php

Codecov / codecov/patch

src/Laravel/ApiPlatformDeferredProvider.php#L357

Added line #L357 was not covered by tests
];
}
}
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.