Migrate ProductAttributesRestApi to API Platform

Edit on GitHub

This document describes how to migrate the ProductAttributesRestApi Glue module to the API Platform ProductAttribute module.

Prerequisites

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

Overview

The ProductAttributesRestApi module provided the following storefront endpoint:

Endpoint Operation Old plugin
GET /product-management-attributes List product management attributes ProductManagementAttributesResourceRoutePlugin
GET /product-management-attributes/{key} Get product management attribute ProductManagementAttributesResourceRoutePlugin

These are now served by the API Platform ProductAttribute module.

1. Update module dependencies

composer require spryker/product-attribute:"^X.Y.Z"
Version

Use the version that includes the API Platform resources. Check the module changelog for the exact version.

2. Remove route plugin from GlueApplicationDependencyProvider

In src/Pyz/Glue/GlueApplication/GlueApplicationDependencyProvider.php, remove the following plugin from getResourceRoutePlugins():

Plugin to remove Fully qualified class name
ProductManagementAttributesResourceRoutePlugin Spryker\Glue\ProductAttributesRestApi\Plugin\GlueApplication\ProductManagementAttributesResourceRoutePlugin

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

The ProductAttributesRestApi module did not register any relationship plugins. No relationship changes are needed.