Migrate ProductLabelsRestApi to API Platform

Edit on GitHub

This document describes how to migrate the ProductLabelsRestApi Glue module to the API Platform ProductLabel module.

Prerequisites

Complete the cross-cutting changes described in Migrate Glue REST API to API Platform before proceeding.

Overview

The ProductLabelsRestApi module provided the following storefront endpoints:

Endpoint Operation Old plugin
GET /product-labels List product labels ProductLabelsResourceRoutePlugin
GET /product-labels/{productLabelId} Get product label ProductLabelsResourceRoutePlugin

These are now served by the API Platform ProductLabel module.

1. Update module dependencies

composer require spryker/product-label:"^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 plugin from getResourceRoutePlugins():

Plugin to remove Fully qualified class name
ProductLabelsResourceRoutePlugin Spryker\Glue\ProductLabelsRestApi\Plugin\GlueApplication\ProductLabelsResourceRoutePlugin

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 Status
ProductLabelsRelationshipByResourceIdPlugin (ProductLabelsRestApi) Removed from top-level abstract-products. Remains re-added in the grouped block for related-products and upselling-products legacy Glue endpoints. Do not remove that re-added registration.
ProductLabelByProductConcreteSkuResourceRelationshipPlugin (ProductLabelsRestApi) Removed from top-level concrete-products. Remains re-added in the grouped block for legacy Glue sub-includes (wishlists, configurable bundles). Do not remove that re-added registration.