users@jersey.java.net

[Jersey] Re: In JSON output how do you write a number as a number and not as a string?

From: nbaliga <nbaliga_at_cleartrial.com>
Date: Fri, 17 Feb 2012 06:30:53 -0800 (PST)

Perhaps I am confusing the issue by providing a before and after reference.

In the end, I am trying to use the POJO Mapping Feature in Jersey 1.5 and am
providing a configured Jackson ObjectMapper instance via a
ContextResolver<ObjectMapper> implementation.

I am using Jackson 1.9.

In this scenario, I am seeing numbers being serialized into JSON as quoted
strings instead of just numbers.

When I use ObjectMapper on its own i.e. no Jersey in the picture, a simple
Main class, then the numbers come out without quotes, as they should.

This little test case was my attempt to figure out whether Jackson was the
culprit and not obeying it's WRITE_NUMBERS_AS_STRING=false configuration.

So my feeling here is that there is something in the way Jersey 1.5 is using
Jackson 1.9's ObjectMapper that's causing the problem.

It could be that I may be missing some configuration setting.

--
View this message in context: http://jersey.576304.n2.nabble.com/In-JSON-output-how-do-you-write-a-number-as-a-number-and-not-as-a-string-tp7292424p7294441.html
Sent from the Jersey mailing list archive at Nabble.com.