-
Notifications
You must be signed in to change notification settings - Fork 9.4k
/rest/default/schema - rest API schema request returns 500 error #2417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello @caesarcxiv I'm on GA and am not able to reproduce this issue. I've tried with both the ?services=all parameter and without it. I can use the GUI to see the schema: http://BASEURL/swagger which really just calls the following to get the info http://BASEURL/rest/default/schema?services=all . |
Hello i've tried these : http://BASEURL/swagger, http://BASEURL/rest/default/schema?services=all and http://BASEURL/rest/default/schema and I still get the same error logged above. |
The error message below makes me suspect there is a service contract that is not specifying the fully qualified path name to a type. This is a guess however. Do you have any of your own service contracts defined? Can you find "array[]" or even "array" there somewhere?
The error message could certainly do with improving to provide better context. If we can find the cause of the error we can look at fixing up the error message for future similar situations. |
closing due inactivity from @caesarcxiv on @alankent last request. |
@maksek I would ask that this possibly be reopened. I am having this issue. Specifically with regard to the system generating information for the interface \Magento\Sales\Api\ShipOrderInterface.php The error they are having is caused by the parameters to the execute function (for parameter $items, although the issue also lies with $tracks and $packages). We are currently running on : It seems to me as though the reflection classes are not grabbing the actual class type from the doc block above the method and instead are passing in array[] as the type for the parameter. And, now, thinking about it, I can see in the class: magento2/vendor/magento/framework/Reflection/TypeProcessor.php That the regular expression matching for the parameter in the function getParamType is failing to match the param in the docblock for this particular parameter... but not for others. I don't know why. Perhaps I have stumbled upon a bug with the regular expression engine in the version of PHP we are using. I am upgrading my local version just to be certain. Upgraded to 7.0.14 and it is still happening. I have created a simple test program that uses base64 encoded values for the regular expressions and the doc blocks from 3 cases (2 that pass, one that fails) to illustrate the issue. I encoded the strings to any possible differences such as newline characters will be preserved. Here is that test program:
The output from that test case is:
The stack trace we see is:
|
I added a piece of output code to my test case, to output the files using json_encoding so I could see exactly what the characters used are... This is an issue of \r\n vs \n in the file in question. SIGH. I would suggest updating the regular expression to include an optional \r So line 558 in magento2/vendor/magento/framework/Reflection/TypeProcessor.php goes from: To
I would send a pull request, but I don't have time this minute to create a unit test (my environment is seutp for enterprise, not community) |
[CMS Team 2] Skipping Unstable MFTF Tests
Release 2.0 (worked on RC2) - schema will not load. API stil functions.
[2015-11-19 03:26:10] main.CRITICAL: exception 'LogicException' with message 'Report ID: webapi-564d4152b7a95; Message: Class "array[]" does not exist. Please note that namespace must be specified.' in FAKEPATH\lib\internal\Magento\Framework\Webapi\ErrorProcessor.php:194
Stack trace:
#0 FAKEPATH\lib\internal\Magento\Framework\Webapi\ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(LogicException))
#1 FAKEPATH\app\code\Magento\Webapi\Controller\Rest.php(163): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(LogicException))
#2 FAKEPATH\var\generation\Magento\Webapi\Controller\Rest\Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#3 FAKEPATH\lib\internal\Magento\Framework\App\Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#4 FAKEPATH\lib\internal\Magento\Framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#5 FAKEPATH\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#6 {main} [] []
The text was updated successfully, but these errors were encountered: