{"action":"created","issue":{"url":"https://api.github.com/repos/wisdom-framework/wisdom/issues/458","labels_url":"https://api.github.com/repos/wisdom-framework/wisdom/issues/458/labels{/name}","comments_url":"https://api.github.com/repos/wisdom-framework/wisdom/issues/458/comments","events_url":"https://api.github.com/repos/wisdom-framework/wisdom/issues/458/events","html_url":"https://github.com/wisdom-framework/wisdom/issues/458","id":64570189,"number":458,"title":"@Body should allow Parametric Types for Json mapping","user":{"login":"magnet","id":67098,"avatar_url":"https://avatars.githubusercontent.com/u/67098?v=3","gravatar_id":"","url":"https://api.github.com/users/magnet","html_url":"https://github.com/magnet","followers_url":"https://api.github.com/users/magnet/followers","following_url":"https://api.github.com/users/magnet/following{/other_user}","gists_url":"https://api.github.com/users/magnet/gists{/gist_id}","starred_url":"https://api.github.com/users/magnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnet/subscriptions","organizations_url":"https://api.github.com/users/magnet/orgs","repos_url":"https://api.github.com/users/magnet/repos","events_url":"https://api.github.com/users/magnet/events{/privacy}","received_events_url":"https://api.github.com/users/magnet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-26T16:14:27Z","updated_at":"2015-03-26T16:46:39Z","closed_at":null,"body":"Currently, using @Body on a parameter that has a generic type only provides the Jackson Mapper with the raw type.\r\n\r\ne.g\r\npublic Result action(@Body Foo<Bar> foo) { }\r\n// currently Jackson knows only about the raw type Foo\r\n\r\nGeneric type info should be passed to allow Jackson to use the right deserializers.\r\n\r\nRight now the workaround is not to use the @Body annotation and use the Jackson mapper with the proper TypeReference or by constructing a JavaType."},"comment":{"url":"https://api.github.com/repos/wisdom-framework/wisdom/issues/comments/86616546","html_url":"https://github.com/wisdom-framework/wisdom/issues/458#issuecomment-86616546","issue_url":"https://api.github.com/repos/wisdom-framework/wisdom/issues/458","id":86616546,"user":{"login":"cescoffier","id":402301,"avatar_url":"https://avatars.githubusercontent.com/u/402301?v=3","gravatar_id":"","url":"https://api.github.com/users/cescoffier","html_url":"https://github.com/cescoffier","followers_url":"https://api.github.com/users/cescoffier/followers","following_url":"https://api.github.com/users/cescoffier/following{/other_user}","gists_url":"https://api.github.com/users/cescoffier/gists{/gist_id}","starred_url":"https://api.github.com/users/cescoffier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cescoffier/subscriptions","organizations_url":"https://api.github.com/users/cescoffier/orgs","repos_url":"https://api.github.com/users/cescoffier/repos","events_url":"https://api.github.com/users/cescoffier/events{/privacy}","received_events_url":"https://api.github.com/users/cescoffier/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T16:46:39Z","updated_at":"2015-03-26T16:46:39Z","body":"Here are two approaches:\n\n1. Adding parameter to @Body:\nIt seems to be possible if we pass a list of class to `@Body`\nFor instance, you would be something like:\n\n```\npublic Result action(@Body(String.class) Foo<String> foo) {\n}\n```\n\nThis would be the most reliable.\n\n2. Inferring type\nHowever, we may be able to retrieve the full type of the parameter as we do in the parameter converters. \n\nI definitely prefers the second approach, but I'm not sure it's (always) possible."}}