I have a object of type:
RestConsumerRequest<RewardsAccumulationRequest>
which has @JsonProperty annotated fields like:
@JsonProperty("product_code")
private String productCode;
@JsonProperty("sub_product_code")
private String subProductCode;
when I write it as String using:
objectMapper.writeValueAsString(restRequest)
I get:
"product_code":"CSS","sub_product_code":"SC",...
I tried remove the backslash “” with:
objectMapper.writeValueAsString(restRequest).replace("\","")
the backlashes are still there.
what is the proper way to remove the backslashes?