03-23-2021 11:03 AM - edited 02-03-2024 9:44 PM
Hi, I'm trying to exclude some WsDTO fields to the request output, such as firstName from UserWsDTO.
I'm using @JsonIgnoreProperties to exclude that but It doesn't seem to work:
<bean class="de.hybris.platform.commercewebservicescommons.dto.user.UserWsDTO">
<import type="com.fasterxml.jackson.annotation.JsonIgnore" />
<import type="com.fasterxml.jackson.annotation.JsonIgnoreProperties" />
<annotations>
@JsonIgnoreProperties({"firstName})
</annotations>
<property name="fidelityCard" type="java.lang.String"/>
</bean>
I couldn't use @JsonIgnore directly on the field because It's and unmodifiable field from Hybris, and I was looking if there was a way to "override" some fields so that I could use JsonIgnore like this:
<bean>
<import type="com.fasterxml.jackson.annotation.JsonIgnore" />
<import type="com.fasterxml.jackson.annotation.JsonIgnoreProperties" />
<property name="fidelityCard" type="java.lang.String"/>
<property name="firstName" type="java.lang.String">
<annotations>
@JsonIgnore()
</annotations>
</property>
</bean>
User | Count |
---|---|
4 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.