Hi,
For jackson:2.x
<jaxrs:providers>
<bean
class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider">
<constructor-arg>
<bean
class="com.fasterxml.jackson.databind.ObjectMapper">
<property name="serializationInclusion"
value="NON_NULL" />
</bean>
</constructor-arg>
</bean>
...
</jaxrs:providers>
On Sun, 07 Oct 2018 10:14:29 +0300, Kulbhushan Azad
<[email protected]> wrote:
> hi ,
>
> i am trying to remove the null values from my json response,However , i
> am
> not able to get it removed.
> i am using CXF 3.0.6 and jackson:2.9.1.
> How can i troubleshoot this? how do i see which jsonprovider is being
> used?
> how can i get rid of the null values ?
>
> i have a POJO with below annotation at the class level.
>
> @JsonInclude(JsonInclude.Include.NON_NULL)
>
> and below is the rest service spring configuration
>
> <jaxrs:server id="testService" address="/test">
> <jaxrs:serviceBeans>
> <ref bean="testBean" />
> </jaxrs:serviceBeans>
> <jaxrs:extensionMappings>
> <entry key="xml" value="application/xml" />
> <entry key="text" value="application/text" />
> <entry key="gzip" value="application/gzip" />
> <entry key="octet-stream"
> value="application/octet-stream"
> />
> </jaxrs:extensionMappings>
> <jaxrs:providers>
> <ref bean="jsonProvider" />
> </jaxrs:providers>
> <jaxrs:features>
> <cxf:logging />
> </jaxrs:features>
> </jaxrs:server>
>
> <bean id="jsonProvider"
> class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />
--
Regards, Alexey.
As a recipient of an email from Talend, your contact personal data will be on
our systems. Please see our contacts privacy notice at Talend, Inc.
<https://www.talend.com/contacts-privacy-policy/>