Migrate ProductImageSetsRestApi to API Platform

Edit on GitHub

This document describes how to migrate the ProductImageSetsRestApi Glue module to the API Platform ProductImage module.

Prerequisites

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

Overview

The ProductImageSetsRestApi module provided the following storefront endpoints:

Endpoint Operation Old plugin
GET /abstract-products/{abstractProductSku}/abstract-product-image-sets Get abstract product image sets AbstractProductImageSetsRoutePlugin
GET /concrete-products/{concreteProductSku}/concrete-product-image-sets Get concrete product image sets ConcreteProductImageSetsRoutePlugin

These are now served by the API Platform ProductImage module.

1. Update module dependencies

composer require spryker/product-image:"^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
AbstractProductImageSetsRoutePlugin Spryker\Glue\ProductImageSetsRestApi\Plugin\AbstractProductImageSetsRoutePlugin
ConcreteProductImageSetsRoutePlugin Spryker\Glue\ProductImageSetsRestApi\Plugin\ConcreteProductImageSetsRoutePlugin

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
ConcreteProductsProductImageSetsResourceRelationshipPlugin (ProductImageSetsRestApi) 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.
AbstractProductsProductImageSetsResourceRelationshipPlugin (ProductImageSetsRestApi) 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.