Android sending POST Json using JAX-RS receiving object with array null [closed]

1

I'm trying to post an object but the array only comes null .. can anyone tell me what's wrong?

@XmlRootElement
public class Produto implements Serializable{

    private String nome;
    get e set...

    private List<Tipo> tipos;
    get e set...

}

@XmlRootElement
public class Tipo implements Serializable{

    private String nome;
    get e set...

}

this is the method with your annotations

@POST
@Path("/cadastrar")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response addProduto(Produto produto)

follows the json format I'm sending

{
"nome":"Teste produto",
"tipos":[{"nome":"Teste 1"},{"nome":"Teste 2"},{"nome":"Teste 3"}]
}

The problem is that the product only comes with the name, the List is coming null, does anyone have any idea what it is?!

    
asked by anonymous 13.11.2015 / 01:27

0 answers