springbot / magento2-plugin

Springbot integration for the Magento 2 platform
GNU General Public License v3.0
6 stars 7 forks source link

New ProductRepositoryInterfaceV2 breaks Magento WebAPI functionality for swagger #35

Closed zack6849 closed 6 years ago

zack6849 commented 6 years ago

Hi There!

It seems your new class introduced in commit https://github.com/springbot/magento2-plugin/commit/777cc3e79a3d73af00fde0543aae46198ed6cf6f#diff-7ecff4ab7ab3441d131e4334a05736ad breaks magento 2's swagger interface with an error because it expects the string to end with "Interface" and yours is InterfaceV2, making the code in Magento\WebApi\Model\ServiceMetadata::getServiceName() fail as there are only 3 matches, not 4.

screen shot 2018-09-19 at 10 33 26 am

Resulting in the following stack trace:

Notice: Undefined offset: 4 in /var/www/html/vendor/magento/module-webapi/Model/ServiceMetadata.php on line 216

#0 /var/www/html/vendor/magento/module-webapi/Model/ServiceMetadata.php(216): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined offse...', '/var/www/html/v...', 216, Array)
#1 /var/www/html/vendor/magento/module-webapi/Model/ServiceMetadata.php(115): Magento\Webapi\Model\ServiceMetadata->getServiceName('Springbot\\Main\\...', 'V2')
#2 /var/www/html/vendor/magento/module-webapi/Model/ServiceMetadata.php(156): Magento\Webapi\Model\ServiceMetadata->initServicesMetadata()
#3 /var/www/html/vendor/magento/module-webapi/Model/Rest/Swagger/Generator.php(923): Magento\Webapi\Model\ServiceMetadata->getServicesConfig()
#4 /var/www/html/vendor/magento/module-webapi/Controller/Rest/SchemaRequestProcessor.php(53): Magento\Webapi\Model\Rest\Swagger\Generator->getListOfServices()
#5 /var/www/html/vendor/magento/module-webapi/Controller/Rest.php(244): Magento\Webapi\Controller\Rest\SchemaRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))
#6 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#7 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)
#8 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#9 /var/www/html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)
#10 /var/www/html/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#11 /var/www/html/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()
#12 /var/www/html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#13 {main}
JoeyK4816 commented 6 years ago

Thank you for submitting this issue. Our team will review your changes internally and respond here.

JoeyK4816 commented 6 years ago

@zack6849 Thanks for your report. This issue is being addressed in the pull request #37. We are currently testing the modification but had to make more updates than what was in your pull request. This PR will be merged into release version 1.6.12 later today.