this is my Endpoint in which I would like to add a "Firma" with a post request, but the JSON
cannot implicit parse the timestamp
.
@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response addFirma(Firma firma){
firmaFacade.create(firma);
return Response.ok().build();
}
Those are the variables of "Firma"
private int firm1;
private LocalDate firm2;
And this is the JSON-String I sent - LocalDate is NULL
{
"firm1":2,
"firm2":"2017-09-09"
}
But whenever I use the get Request with test data, it will show me the right result:
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response findFirma() {
List<Firma> list = firmaFacade.findAll();
GenericEntity<List<Firma>> result = new GenericEntity<List<Firma>>(list) { };
return Response.ok().entity(result).build();
}
Please help someone.