cancel
Showing results for 
Search instead for 
Did you mean: 

REST API parser does not handle http request encoding correctly after upgrade from 2.00 to 2.02

REST API parser does not handle http request encoding correctly after upgrade from 2.00 to 2.02

I have written Order Repository queries, which were parse correctly when we have 2.00.

However, the same queries failed after we upgrade our server in 2.02. 

After some trial and error, I believe it was caused by the fact that I encode my query parameters (though it was a good practice).

Not all encoded queries failed, some worked. But if I turn off the encoding, the failed ones is working again.

 

This failed (but was working in 2.00)

http://magento-staging.jazzercise.com:3080/rest/V1/orders?searchCriteria%5Bfilter_groups%5D%5B0%5D%5...

and here's the response

{"message":"%fieldName is a required field.","parameters":{"fieldName":"searchCriteria"},"trace":"#0 \/var\/www\/html\/magento\/vendor\/magento\/framework\/Webapi\/ServiceInputProcessor.php(111): Magento\\Framework\\Webapi\\ServiceInputProcessor->processInputError(Array)\n#1 \/var\/www\/html\/magento\/vendor\/magento\/module-webapi\/Controller\/Rest.php(262): Magento\\Framework\\Webapi\\ServiceInputProcessor->process('Magento\\\\Sales\\\\A...', 'getList', Array)\n#2 \/var\/www\/html\/magento\/vendor\/magento\/module-webapi\/Controller\/Rest.php(160): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#3 \/var\/www\/html\/magento\/var\/generation\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(24): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#4 \/var\/www\/html\/magento\/vendor\/magento\/framework\/App\/Http.php(115): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#5 \/var\/www\/html\/magento\/vendor\/magento\/framework\/App\/Bootstrap.php(258): Magento\\Framework\\App\\Http->launch()\n#6 \/var\/www\/html\/magento\/pub\/index.php(37): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\n#7 {main}"}

but this worked

http://magento-staging.jazzercise.com:3080/rest/V1/orders?searchCriteria[filter_groups][0][filters][...

 

 

 

1 REPLY 1

Re: REST API parser does not handle http request encoding correctly after upgrade from 2.00 to 2.02

Have you reported on GitHub? Sounds like a potential bug so I would report over there. Then the Engineers can track it etc.