Timeline for how to get mixed or multi array response in rest API magento2
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 17, 2017 at 8:31 | comment | added | Erfan | @AlexPaliarush since Magento 2.2 mixed does not seem to work any more. | |
Apr 13, 2017 at 12:54 | history | edited | CommunityBot |
replaced http://magento.stackexchange.com/ with https://magento.stackexchange.com/
|
|
Dec 22, 2015 at 11:28 | comment | added | Alex Paliarush |
Try mixed[] for now. Also consider creating pull request with the proposed improvement on Magento 2 github (\Magento\Framework\Reflection\TypeProcessor::processSimpleAndAnyType is a good starting point for improving current behavior)
|
|
Dec 22, 2015 at 11:18 | comment | added | Pradeep Kumar | but array of array i not possible in that case | |
Dec 22, 2015 at 10:39 | comment | added | Alex Paliarush |
There is, and it is even used in core already, see \Magento\Sales\Api\Data\TransactionInterface::setAdditionalInformation . Also check \Magento\Framework\Reflection\TypeProcessor::ANY_TYPE . The only difference, in your case it is as @return , not @param . Try to specify it for some param, to verify if it works for you in this case.
|
|
Dec 22, 2015 at 10:36 | comment | added | Pradeep Kumar | @ale:- there i no mixed type if i used mixed then through error | |
Dec 22, 2015 at 9:23 | comment | added | Alex Paliarush |
Use mixed return type instead of introducing new array type with custom processing, result should be the same.
|
|
Dec 22, 2015 at 7:12 | history | answered | Pradeep Kumar | CC BY-SA 3.0 |