Skip to content

API changes in Magento 2.5 #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Introduce HLD for missing API declaration #47
- Described auto-generated code that needs to be marked as @api in 2.5
- Added sections about exceptions and extension attribute classes
  • Loading branch information
paliarush committed Dec 22, 2020
commit d32eed9ce8a6afe57ba7b975efe77cf52c40658c
32 changes: 27 additions & 5 deletions design-documents/api-clean-up/2.5/api-candidates.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Auto-generated code
1. Auto generated code needs to be marked as @api:
1. \Magento\Framework\Api\Code\Generator\ExtensionAttributesInterfaceFactoryGenerator
1. \Magento\Framework\Api\Code\Generator\ExtensionAttributesInterfaceGenerator
1. \Magento\Framework\Api\Code\Generator\ExtensionAttributesGenerator
1. \Magento\Framework\MessageQueue\Code\Generator\RemoteServiceGenerator
1. Factories generated for @api entities must also be marked as @api. Factories for non-@api must not be marked as @api
1. \Magento\Framework\ObjectManager\Code\Generator\Factory

# Interfaces to be marked as is

1. adobe-ims/AdobeImsApi/Api/LogInInterface.php
Expand Down Expand Up @@ -280,7 +289,6 @@
1. app/code/Magento/Wishlist/Model/AuthenticationStateInterface.php
1. app/code/Magento/Wishlist/Model/ResourceModel/Item/Product/CollectionBuilderInterface.php
1. app/code/Magento/Wishlist/Model/Wishlist/BuyRequest/BuyRequestDataProviderInterface.php
1. inventory/InventoryApi/Api/Data/StockExtensionInterface.php
1. inventory/InventoryApi/Model/IsProductAssignedToStockInterface.php
1. inventory/InventoryCatalogApi/Model/SourceItemsProcessorInterface.php
1. inventory/InventoryInStorePickupGraphQl/Model/Resolver/PickupLocations/SearchRequest/ResolverInterface.php
Expand Down Expand Up @@ -609,7 +617,6 @@
1. lib/internal/Magento/Framework/Webapi/CustomAttribute/PreprocessorInterface.php
1. lib/internal/Magento/Framework/Webapi/CustomAttribute/ServiceTypeListInterface.php
1. lib/internal/Magento/Framework/Webapi/Rest/Request/DeserializerInterface.php
1. magento2-page-builder/app/code/Magento/PageBuilder/Api/Data/TemplateExtensionInterface.php
1. magento2-page-builder/app/code/Magento/PageBuilder/Api/Data/TemplateInterface.php
1. magento2-page-builder/app/code/Magento/PageBuilder/Api/Data/TemplateSearchResultsInterface.php
1. magento2-page-builder/app/code/Magento/PageBuilder/Api/TemplateRepositoryInterface.php
Expand Down Expand Up @@ -662,11 +669,8 @@
1. magento2b2b/app/code/Magento/PurchaseOrder/Model/ProcessorInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrder/Model/Validator/ActionReady/ValidatorInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrder/Model/Validator/ValidatorInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/AppliedRuleApproverExtensionInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/AppliedRuleApproverSearchResultsInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/AppliedRuleExtensionInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/AppliedRuleSearchResultsInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/RuleExtensionInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/RuleSearchResultsInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Model/Rule/ConditionInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Model/Rule/ValidateInterface.php
Expand Down Expand Up @@ -773,3 +777,21 @@
1. app/code/Magento/Quote/Model/GuestCart/GuestShippingMethodManagementInterface.php: Interface with the same name exists in /Api/ scope, which is confusing. Need to refactor somehow to eliminate confusion and then mark as @api in 2.5. Deprecate in 2.4
1. app/code/Magento/Quote/Model/ShippingMethodManagementInterface.php: Interface with the same name exists in /Api/ scope, which is confusing. Need to refactor somehow to eliminate confusion and then mark as @api in 2.5. Deprecate in 2.4
1. app/code/Magento/MediaGalleryUi/Model/InsertImageDataInterface.php: This interface should be extracted to a separate module together with GetInsertImageData and GetInsertImageContent services and marked as API

# Exceptions that need to be marked as API
1. app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php
1. app/code/Magento/SalesRule/Api/Exception/CodeRequestLimitException.php
1. magento2ee/app/code/Magento/GiftCardAccount/Api/Exception/TooManyAttemptsException.php

# Manually created extension attributes

Even though extension attributes PHP classes/interfaces were not supposed to be created manually, we have several such occurrences.
It is preferable to remove these classes/interfaces because they block extensibility of the parent interfaces.
Motivation for having these overrides should be analyzed in each case separately. For example, `inventory/InventoryApi/Api/Data/StockExtension.php` was overridden to resolve incorrect code generation during Magento installation (Valerii Naida can provide more details).

1. inventory/InventoryApi/Api/Data/StockExtension.php
1. inventory/InventoryApi/Api/Data/StockExtensionInterface.php
1. magento2-page-builder/app/code/Magento/PageBuilder/Api/Data/TemplateExtensionInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/AppliedRuleApproverExtensionInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/AppliedRuleExtensionInterface.php
1. magento2b2b/app/code/Magento/PurchaseOrderRule/Api/Data/RuleExtensionInterface.php