{"action":"opened","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/3275","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/3275/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/3275/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/3275/events","html_url":"https://github.com/magento/magento2/issues/3275","id":131072226,"number":3275,"title":"REST API POST of a 2D array results in error","user":{"login":"augsteyer","id":844601,"avatar_url":"https://avatars.githubusercontent.com/u/844601?v=3","gravatar_id":"","url":"https://api.github.com/users/augsteyer","html_url":"https://github.com/augsteyer","followers_url":"https://api.github.com/users/augsteyer/followers","following_url":"https://api.github.com/users/augsteyer/following{/other_user}","gists_url":"https://api.github.com/users/augsteyer/gists{/gist_id}","starred_url":"https://api.github.com/users/augsteyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augsteyer/subscriptions","organizations_url":"https://api.github.com/users/augsteyer/orgs","repos_url":"https://api.github.com/users/augsteyer/repos","events_url":"https://api.github.com/users/augsteyer/events{/privacy}","received_events_url":"https://api.github.com/users/augsteyer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-03T16:12:27Z","updated_at":"2016-02-03T16:12:27Z","closed_at":null,"body":"I believe this is a bug where I am trying to pass a JSON object like this \r\n\r\n```\r\n{\r\n   \"action\":\"get_setting\",\r\n   \"settings\": \r\n   [\r\n      {\r\n         \"name\": \"t\",\r\n         \"value\": \"p\"\r\n      }\r\n   ]\r\n}\r\n```\r\n\r\nWhere the interface looks like this\r\n\r\n```\r\n    /**\r\n     * @param string    $action\r\n     * @param array[][] $settings - the type here is the problem area\r\n     *\r\n     * @return string\r\n     */\r\n    public function setSettings($action, $settings);\r\n```\r\n\r\nI have currently tried many variations of string[][], array[], string[], mixed[], Array[], etc, without any way of passing settings without getting an error thrown at the lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php::process() function. \r\n\r\nThe root cause of the problem is that in lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php::convertValue() it has no way of parsing array of arrays. If it's something like \"string[][]\" it will consider it a simple type and will try to match it to !settype(array(...), string), which results into an error. If it's something unknown like array[][]. It will consider it complex, and try to initialize it as a class, where it will figure out that 'array' is not a class.\r\n\r\nA way of solving, would be to make array a simple type, however I do not know the implications of such change, hence why it's not a pull request. The change would also allow this case to be accepted whether it's array[][] or array[] or array, so most likely not a good solution.\r\n\r\nlib/internal/Magento/Framework/Reflection/TypeProcessor.php::isTypeSimple()\r\n\r\n```\r\n...\r\nreturn in_array(\r\n            $type,\r\n            [\r\n                self::NORMALIZED_STRING_TYPE,\r\n                self::NORMALIZED_INT_TYPE,\r\n                self::NORMALIZED_FLOAT_TYPE,\r\n                self::NORMALIZED_DOUBLE_TYPE,\r\n                self::NORMALIZED_BOOLEAN_TYPE,\r\n                self::NORMALIZED_ARRAY_TYPE //'array' <------ \r\n            ]\r\n        );\r\n```"}}