exception message is wrong and misleading in findAccessorMethodName() of Magento\Framework\Reflection\NameFinder #9764
Labels
bug report
Fixed in 2.2.x
The issue has been fixed in 2.2 release line
Fixed in 2.3.x
The issue has been fixed in 2.3 release line
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Reproduced on 2.1.x
The issue has been reproduced on latest 2.1 release
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
Preconditions
Steps to reproduce
public function getGetterMethodName(ClassReflection $class, $camelCaseProperty)
{
$getterName = 'get' . $camelCaseProperty;
$boolGetterName = 'is' . $camelCaseProperty;
return $this->findAccessorMethodName($class, $camelCaseProperty, $getterName, $boolGetterName);
}
When there is no getter, findAccessorMethodName() generates an exception with message:
' ... does not have corresponding setter in class ... '
This exception is wrong and misleading.
Expected result
Actual result
"message": "Property "IsDefaultBilling" does not have corresponding setter in class "Magento\Customer\Api\Data\AddressInterface".",
trace":
#0 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Reflection\NameFinder.php(59): Magento\Framework\Reflection\NameFinder->findAccessorMethodName(Object(Zend\Code\Reflection\ClassReflection), 'IsDefaultBillin...', 'getIsDefaultBil...', 'isIsDefaultBill...')
#1 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Webapi\ServiceInputProcessor.php(158): Magento\Framework\Reflection\NameFinder->getGetterMethodName(Object(Zend\Code\Reflection\ClassReflection), 'IsDefaultBillin...')
#2 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Webapi\ServiceInputProcessor.php(318): Magento\Framework\Webapi\ServiceInputProcessor->_createFromArray('\Magento\Custom...', Array)
#3 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Webapi\ServiceInputProcessor.php(175): Magento\Framework\Webapi\ServiceInputProcessor->convertValue(Array, '\Magento\Custom...')
#4 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Webapi\ServiceInputProcessor.php(322): Magento\Framework\Webapi\ServiceInputProcessor->_createFromArray('Wilson\Accounta...', Array)
#5 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Webapi\ServiceInputProcessor.php(119): Magento\Framework\Webapi\ServiceInputProcessor->convertValue(Array, 'Wilson\Accounta...')
#6 D:\nginx-1.8.0\websites\magento21\vendor\magento\module-webapi\Controller\Rest\InputParamsResolver.php(101): Magento\Framework\Webapi\ServiceInputProcessor->process('Wilson\Accounta...', 'createProntoAcc...', Array)
#7 D:\nginx-1.8.0\websites\magento21\vendor\magento\module-webapi\Controller\Rest.php(299): Magento\Webapi\Controller\Rest\InputParamsResolver->resolve()
#8 D:\nginx-1.8.0\websites\magento21\vendor\magento\module-webapi\Controller\Rest.php(216): Magento\Webapi\Controller\Rest->processApiRequest()
#9 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Interception\Interceptor.php(74): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#10 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Interception\Chain\Chain.php(70): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)
#11 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Webapi\...', 'dispatch', Object(Magento\Webapi\Controller\Rest\Interceptor), Array, 'infortis_cgen_m...')
#12 D:\nginx-1.8.0\websites\magento21\app\code\Infortis\Cgen\Plugin\Magento\Framework\App\FrontController.php(32): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#13 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\Interception\Interceptor.php(142): Infortis\Cgen\Plugin\Magento\Framework\App\FrontController->aroundDispatch(Object(Magento\Webapi\Controller\Rest\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#14 D:\nginx-1.8.0\websites\magento21\var\generation\Magento\Webapi\Controller\Rest\Interceptor.php(39): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)
#15 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\App\Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#16 D:\nginx-1.8.0\websites\magento21\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#17 D:\nginx-1.8.0\websites\magento21\pub\index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#18 {main}
The text was updated successfully, but these errors were encountered: