1

I'm trying to serialize JSON via JAXB using CXF. The problem is when the element to transform is a Object type.

@XmlElement(name = "Value")
    protected Object value;

the result in JSON format is

"Value":{"@xsi.type":"xs:string","$":"LED"}}

Any idea how I do to transform in simple json format?

"Value":"LED" o r "Value":1 
dma_k
  • 10,431
  • 16
  • 76
  • 128
fphilip
  • 159
  • 1
  • 8

2 Answers2

0

It looks like you have enabled BadgerFish notation for your Jettison converter (I am not aware about BadgerFish notation support in Jackson or MOXy).

If you use JBoss @BadgerFish annotation, just remove it. If you use JSONJAXBContext#BADGERFISH option setting, then change it to MAPPED or NATURAL (check documentation).

dma_k
  • 10,431
  • 16
  • 76
  • 128
0

Set writesiType=false in JSONProvider Bean configuration

Karthik Prasad
  • 9,662
  • 10
  • 64
  • 112