Migrate ContentProductAbstractListsRestApi to API Platform
Edit on GitHubThis document describes how to migrate the ContentProductAbstractListsRestApi Glue module to the API Platform ContentProduct module.
Prerequisites
Complete the cross-cutting changes described in Migrate Glue REST API to API Platform before proceeding.
Overview
The ContentProductAbstractListsRestApi module provided the following storefront endpoints:
| Endpoint | Operation | Old plugin |
|---|---|---|
GET /content-product-abstract-lists/{key} |
Get content product abstract list | ContentProductAbstractListsResourceRoutePlugin |
GET /content-product-abstract-lists/{key}/abstract-products |
Get abstract products for content list | ContentProductAbstractListAbstractProductsResourceRoutePlugin |
These are now served by the API Platform ContentProduct module.
1. Update module dependencies
composer require spryker/content-product:"^X.Y.Z"
Version
Use the version that includes the API Platform resources. Check the module changelog for the exact version.
2. Remove route plugins from GlueApplicationDependencyProvider
In src/Pyz/Glue/GlueApplication/GlueApplicationDependencyProvider.php, remove the following plugins from getResourceRoutePlugins():
| Plugin to remove | Fully qualified class name |
|---|---|
ContentProductAbstractListsResourceRoutePlugin |
Spryker\Glue\ContentProductAbstractListsRestApi\Plugin\GlueApplication\ContentProductAbstractListsResourceRoutePlugin |
ContentProductAbstractListAbstractProductsResourceRoutePlugin (aliased as AbstractProductsResourceRoutePlugin) |
Spryker\Glue\ContentProductAbstractListsRestApi\Plugin\GlueApplication\AbstractProductsResourceRoutePlugin |
3. Regenerate transfers and API resources
docker/sdk cli console transfer:generate
docker/sdk cli glue api:generate
docker/sdk cli glue cache:clear
Relationship plugin status
| Plugin | Registered on resource | Status | Notes |
|---|---|---|---|
ProductAbstractByContentProductAbstractListResourceRelationshipPlugin |
content-product-abstract-lists |
Removed | Abstract product relationships are now handled by the API Platform ContentProduct module via ?include=abstract-products. |
Thank you!
For submitting the form