دنبال کننده ها

۱۳۹۶ دی ۱۳, چهارشنبه

jax rs - Restlet JAX-RS deserializes into ArrayList

[ad_1]



I started using the Restlet JAX-RS extension, but I'm finding that lists get deserialized into an ArrayList of LinkedHashMap instead of the class.



@Path("MyService")
public class MyService
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("myTestMethod")
public String testIt(final List<MyTestClass> myList)
return "hello";



public class MyTestClass
@JsonProperty("name")
private String name;



Any ideas on how to have Jackson deserialize into List<MyTestClass>? It works fine when I don't use the JAX-RS extension, but I need this to port over some existing web services.



Thanks for any help.




[ad_2]

لینک منبع