Magento: 2.3.3
webapi.xml and add a route URL. For Example: <route url="/V1/mymodule/myurl" method="GET">
<service class="MyVendor\MyModule\Api\MyRepositoryInterface" method="getMyContent"/>
</route>
Create a repository interface and class MyVendor\MyModule\Api\MyRepositoryInterface but do not add the method getMyContent in any.
Run php bin/magento setup:di:compile and results success.
Run php bin/magento setup:upgrade and results fatal error as below.
Notice: Undefined index: create in /magento-root/vendor/magento/framework/Reflection/MethodsMap.php on line 83
same as above.
The below method does not check if the index is available or throws any exception to debug.
I would suggest throwing an Exception with the interface name and function that is missing. which will really help in debugging the error.
Hi @milindsingh. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
@milindsingh do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
Hi @milindsingh thanks for your issue, I'll check it. Are you using production mode, aren't you?
Thanks @marcoaacoliveira
I am on developer mode still, I think the same will happen on production mode too.
@milindsingh I couldn't reproduced it neither on Magento 2.3.2 nor 2.4 (in setup:upgrade step, I don't have a clean instance of Magento 2.3.3 right now so I didn't try on it), but when I tried to access swagger I got strange errors (that doesn't mean anything). I think it would be a good improvement throws exceptions in this case.
Thanks @marcoaacoliveira I have tried in 2.4-develop but unable to reproduce. So closing it for now.