cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-6870) CXF doesn't check the message body's generic type
Date Mon, 25 Jul 2016 15:40:20 GMT

     [ https://issues.apache.org/jira/browse/CXF-6870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Kulp updated CXF-6870:
-----------------------------
    Fix Version/s:     (was: 3.0.10)
                       (was: 3.1.7)
                       (was: 3.2.0)

> CXF doesn't check the message body's generic type
> -------------------------------------------------
>
>                 Key: CXF-6870
>                 URL: https://issues.apache.org/jira/browse/CXF-6870
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.3, 3.1.6, 3.0.9
>         Environment: mac, windows
>            Reporter: Neal Hu
>         Attachments: ListAProvider.java, ListBProvider.java, Resource.java, beans.xml
>
>
> CXF doesn't check the message body's generic type, please see the sample below.
> {code:java}
> public class ListAProvider implements MessageBodyWriter<List<String>> 
> public class ListBProvider implements MessageBodyWriter<List<Integer>> 
> resource class:
> 	@GET
> 	@Path("/echo/{param}")
> 	@Produces("application/json")
> 	public List<String> echo(@PathParam("param")String name){
> 		List<String> list = new ArrayList<String>();
> 		list.add("hello");
> 		list.add(name);
> 		return list;
> 	}
> 	
> 	@GET
> 	@Path("/echo2/{param}")
> 	@Produces("application/json")
> 	public List<Integer> echo2(@PathParam("param")String name){
> 		List<Integer> list = new ArrayList<Integer>();
> 		list.add(1);
> 		list.add(2);
> 		return list;
> 	}
> {code}
> No matter you request echo or echo2 resource method, the selected provider is ListBProvider



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message