Skip to content

Commit fcd8ef5

Browse files
committed
fix(laravel): remove json api provider
We don't need this anymore as implementing filters and pagination is done by users using the QueryParameter, and users MAY follow the specification if they want to (as the specification doesn't enforce anything but only recommends)
1 parent 53e654d commit fcd8ef5

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/Laravel/ApiPlatformProvider.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
use ApiPlatform\JsonApi\Serializer\ItemNormalizer as JsonApiItemNormalizer;
5858
use ApiPlatform\JsonApi\Serializer\ObjectNormalizer as JsonApiObjectNormalizer;
5959
use ApiPlatform\JsonApi\Serializer\ReservedAttributeNameConverter;
60-
use ApiPlatform\JsonApi\State\JsonApiProvider;
6160
use ApiPlatform\JsonLd\Action\ContextAction;
6261
use ApiPlatform\JsonLd\AnonymousContextBuilderInterface;
6362
use ApiPlatform\JsonLd\ContextBuilder as JsonLdContextBuilder;
@@ -433,16 +432,8 @@ public function register(): void
433432
return new ValidateProvider($app->make(SwaggerUiProvider::class), $app);
434433
});
435434

436-
$this->app->singleton(JsonApiProvider::class, function (Application $app) {
437-
/** @var ConfigRepository */
438-
$config = $app['config'];
439-
440-
// TODO: improve the JsonApiProvider and check the operation parameters for an OrderFilter
441-
return new JsonApiProvider($app->make(ValidateProvider::class), 'sort');
442-
});
443-
444435
$this->app->singleton(DeserializeProvider::class, function (Application $app) {
445-
return new DeserializeProvider($app->make(JsonApiProvider::class), $app->make(SerializerInterface::class), $app->make(SerializerContextBuilderInterface::class));
436+
return new DeserializeProvider($app->make(ValidateProvider::class), $app->make(SerializerInterface::class), $app->make(SerializerContextBuilderInterface::class));
446437
});
447438

448439
$this->app->tag([PropertyFilter::class], SerializerFilterInterface::class);

0 commit comments

Comments
 (0)