Tom Eicher
unread,Jan 26, 2022, 9:10:50 AM1/26/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WildFly
Hello, I know this is not really a Wildfly problem, but, ...
after the upgrade to Wildfly 25 (from 10) REST messages will omit null values, e.g. for
@XmlAccessorType(XmlAccessType.FIELD)
public static class Facade {
public String x = null;
}
@Produces({"application/json;charset=UTF-8"}) @Path("xxx")
public Response xxx() {
...
return Response.ok(new Facade()).build();
}
it used to return like
{ "x": null }
but now it returns like
{ }
I guess this is due to a newer RESTEasy version?
RESTEasy uses Jackson for JSON, right ?
So I would have to somehow/somewhere do a
mapper.setSerializationInclusion(Include.NON_NULL); ?
I tried various flavors of @NotNull, @JsonInclude(Include.ALWAYS),
@XmlElement(required = true) on the facade but nothing helped...
Any help appreciated!
Thx Cheers Tom.