I don't want one of my Java class model field to appear in the output if my accept type is .accept(MediaType.APPLICATION_XML)
but the same field should appear in .accept(MediaType.APPLICATION_JSON)
.
Is there a way to achieve this?
I tried @XmlAccessorType(XmlAccessType.NONE)
as well as @XmlTransient
but both seems to hide from JSON output also.