Magento2 override core interface class to add extra functions,


To extend the core interface class to add ExtensibleDataInterface to the interface

Can someone please guide how to do this?

  • Can you please share which core interface you are trying to extend Feb 16, 2022 at 5:18
  • @VishwasBhatnagar Magento\Catalog\Api\Data\CategoryTreeInterface
    – Arjun
    Feb 16, 2022 at 5:20

1 Answer 1


Magento 2 Preference does not allow us to override the interfaces. Preferences are used to specify the implementation classes for the interfaces and overriding implementation classes. It does not allow to override interface with an interface

The best solution for you is to create a patch for adding ExtensibleDataInterface

Also, I would suggest you check is there a specific reason Magento hasn't made that interface Extensible

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.