1

I'm currently writing a Jersey REST interface. I'm have this code which I'm trying to create the following JSON response and a list of long is been generated a array of string (Using Jaxb and Jackson)

The code looks like :

@XmlElement(name = "visitorProfiles", required = false)
private List<Long> visitorProfiles;

The JSON reponse looks like

{
   "visitorProfiles":["45"]
}

And I correct JSON response should be

{
   "visitorProfiles":[45]
}

This is what I'm using for the JSON configuration

context = new JSONJAXBContext(JSONConfiguration.natural().rootUnwrapping(true).build(),                 JerseyResources.getJaxbClasses());

1 Answer 1

0

Tried to reproduce the case with no success, I can't see any reason for this to happen unless the natural context wasn't apply correctly for that class

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.