How to set Interfaces for custom module API creation in Magento2
I have the following JSON as input to my custom API. But I can't set interface to get this done. I'm still getting the following error message: Message: Property "0" does not have corresponding setter in class "Magecart\Productapi\Api\Data\LocationsInterface" Please point me to where am doing wrong. I tried following: app\code\Test\Productapi\etc\w...
Why auto generated Factories do not extends or implements any classes (interfaces)
This is more abstract question then specific problem. Why auto-generated factories in magento do not implements any common interface? And what bothers me maybe more. Why auto-generated factories doesn't extend each other, so they could be properly passed as arguments. For example. I have class MagicClass. Then I make a class class MoreMagicClass ex...
Magento 2 - get categories by using interfaces in API
In Magento 2, you're supposed to use the interfaces in Magento's API. So, when you want to fetch product(s), you'd use \Magento\Catalog\Api\ProductRepositoryInterface. That works great and it's very convenient. Now when I want to get a list of categories, based on my search criteria. What's the best way to approach this? I don't really see the opti...
Magento 2 : injecting models, interfaces in constructor magento
I'm new to magento 2 and I'm trying to understand how exactly injections work in magento. I understand that injecting a model and interfaces is the right approach in magento 2. But for some reason when I am trying to inject a model/interface, it throws me and error where as when I use objectManager to get an instance of it, it would work. For examp...
The purpose of the http verbs interfaces
In Magento 2.3 there are some interfaces for all the http verbs All of them are empty and implement Magento\Framework\App\ActionInterface. I also found that all of them are mapped in app/etc/di.xml to a parameter of Magento\Framework\App\Request\HttpMethodMap and a lot of the controllers implement these interfaces. But not all controllers. That's a...