You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by Nicholas L Gallardo <nl...@us.ibm.com> on 2009/11/17 15:10:44 UTC
Re: issue with single element in JSON array
Hi Mallik,
What API are you using to model/serialize your JSON data? In other words,
what object type does your resource return?
-Nick
Nicholas Gallardo
WebSphere - REST & WebServices Development
nlgallar@us.ibm.com
Phone: 512-286-6258
Building: 903 / 5G-016
Mallikarjun P
Javali
<mallikarjun@in.i To
bm.com> wink-user@incubator.apache.org
cc
11/17/2009 08:12
AM Subject
issue with single element in JSON
array
Please respond to
wink-user@incubat
or.apache.org
Hello All,
I am trying out Apache Wink and facing some issue with JSON serialization.
I have an array attribute in JSON object.
{
"name" : "abc" ,
phonenos : [ "26641342" , "26543654", "65434321" ]
}
array shows square brackets '[ ]' when data has multiple elements in array.
but if there is a single element in data array shows curly brackets '{ }'
in JSON.
{
"name" : "abc" ,
phonenos : { "26641342" }
}
is there a way I can configure wink to always show square brackets?
Thanks,
Mallik
Re: issue with single element in JSON array
Posted by Bryant Luk <br...@gmail.com>.
Hi Malik,
I don't think this can be changed unless someone with the Jettison
project can modify their code. I think you'll have to raise the issue
with them (http://jettison.codehaus.org/). As an alternative, you can
look into Jackson (http://jackson.codehaus.org/).
On Wed, Nov 18, 2009 at 4:32 AM, Mallikarjun P Javali
<ma...@in.ibm.com> wrote:
> Hi Nick,
> We are using jettison jars to serialize/deserialize data.
> (jettison-1.0.1.jar)..
> in below example phonenos is of type java.util.ArrayList .
>
> Thanks,
> Mallik
>
>
>
>
> From: Nicholas L Gallardo <nl...@us.ibm.com>
>
> To: wink-user@incubator.apache.org
>
> Date: 17/11/2009 19:52
>
> Subject: Re: issue with single element in JSON array
>
>
>
>
>
>
> Hi Mallik,
>
> What API are you using to model/serialize your JSON data? In other words,
> what object type does your resource return?
>
> -Nick
>
>
>
> Nicholas Gallardo
> WebSphere - REST & WebServices Development
> nlgallar@us.ibm.com
> Phone: 512-286-6258
> Building: 903 / 5G-016
>
> (Embedded image moved to file: pic18827.gif)Inactive hide details for
> Mallikarjun P Javali ---11/17/2009 08:03:00 AM---Hello All,Mallikarjun P
> Javali ---11/17/2009 08:03:00 AM---Hello All,
>
> Mallikarjun P
> Javali
> <mallikarjun@in
> .ibm.com> (Embedded image moved to file:
> pic15239.gif)
> To
> 11/17/2009 (Embedded image
> 08:12 AM moved to file:
> pic11211.gif)
> wink-user@incubato
> Please respond to r.apache.org
> wink-user@incubator.apache.org (Embedded image moved to file:
> pic02843.gif)
> cc
> (Embedded image
> moved to file:
> pic16297.gif)
> (Embedded image moved to file:
> pic13172.gif)
> Subject
> (Embedded image
> moved to file:
> pic30983.gif)
> issue with single
> element in JSON
> array
>
>
> (Embedded image moved to file:
> pic06687.gif)
> (Embedded image moved to
> file: pic29908.gif)
>
>
>
>
>
>
>
> Hello All,
> I am trying out Apache Wink and facing some issue with JSON serialization.
> I have an array attribute in JSON object.
>
> {
> "name" : "abc" ,
> phonenos : [ "26641342" , "26543654", "65434321" ]
> }
>
> array shows square brackets '[ ]' when data has multiple elements in array.
> but if there is a single element in data array shows curly brackets '{ }'
> in JSON.
> {
> "name" : "abc" ,
> phonenos : { "26641342" }
> }
>
> is there a way I can configure wink to always show square brackets?
>
> Thanks,
> Mallik
>
>
>
>
> [attachment "pic21598.gif" deleted by Mallikarjun P Javali/India/IBM]
>
Re: issue with single element in JSON array
Posted by Mallikarjun P Javali <ma...@in.ibm.com>.
Hi Nick,
We are using jettison jars to serialize/deserialize data.
(jettison-1.0.1.jar)..
in below example phonenos is of type java.util.ArrayList .
Thanks,
Mallik
From: Nicholas L Gallardo <nl...@us.ibm.com>
To: wink-user@incubator.apache.org
Date: 17/11/2009 19:52
Subject: Re: issue with single element in JSON array
Hi Mallik,
What API are you using to model/serialize your JSON data? In other words,
what object type does your resource return?
-Nick
Nicholas Gallardo
WebSphere - REST & WebServices Development
nlgallar@us.ibm.com
Phone: 512-286-6258
Building: 903 / 5G-016
(Embedded image moved to file: pic18827.gif)Inactive hide details for
Mallikarjun P Javali ---11/17/2009 08:03:00 AM---Hello All,Mallikarjun P
Javali ---11/17/2009 08:03:00 AM---Hello All,
Mallikarjun P
Javali
<mallikarjun@in
.ibm.com> (Embedded image moved to file:
pic15239.gif)
To
11/17/2009 (Embedded image
08:12 AM moved to file:
pic11211.gif)
wink-user@incubato
Please respond to r.apache.org
wink-user@incubator.apache.org (Embedded image moved to file:
pic02843.gif)
cc
(Embedded image
moved to file:
pic16297.gif)
(Embedded image moved to file:
pic13172.gif)
Subject
(Embedded image
moved to file:
pic30983.gif)
issue with single
element in JSON
array
(Embedded image moved to file:
pic06687.gif)
(Embedded image moved to
file: pic29908.gif)
Hello All,
I am trying out Apache Wink and facing some issue with JSON serialization.
I have an array attribute in JSON object.
{
"name" : "abc" ,
phonenos : [ "26641342" , "26543654", "65434321" ]
}
array shows square brackets '[ ]' when data has multiple elements in array.
but if there is a single element in data array shows curly brackets '{ }'
in JSON.
{
"name" : "abc" ,
phonenos : { "26641342" }
}
is there a way I can configure wink to always show square brackets?
Thanks,
Mallik
[attachment "pic21598.gif" deleted by Mallikarjun P Javali/India/IBM]