Migrate NavigationsRestApi to API Platform
Edit on GitHubThis document describes how to migrate the NavigationsRestApi Glue module to the API Platform Navigation module.
Prerequisites
Complete the cross-cutting changes described in Migrate Glue REST API to API Platform before proceeding.
Overview
The NavigationsRestApi module provided the following storefront endpoint:
| Endpoint | Operation | Old plugin |
|---|---|---|
GET /navigations/{id} |
Get navigation tree | NavigationsResourceRoutePlugin |
This is now served by the API Platform Navigation module.
1. Update module dependencies
composer require spryker/navigation:"^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 |
|---|---|
NavigationsResourceRoutePlugin |
Spryker\Glue\NavigationsRestApi\Plugin\ResourceRoute\NavigationsResourceRoutePlugin |
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 |
|---|---|---|---|
CategoryNodeByResourceIdResourceRelationshipPlugin |
navigations |
Removed | The Navigation API Platform provider exposes category node data inline. This plugin was provided by NavigationsCategoryNodesResourceRelationship and registered on the navigations resource. |
Thank you!
For submitting the form