Json to Dynamic

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Json to Dynamic

sledorze
I am accessing a web service on my server (in scala) from a flash client.
This web service returns a Json object.

Is there any good json decoding library that would decode directly into a Dynamic object?
Meaning I could use my structural types on it.

type TData = {
        id : Int,
        type : String,
        category : String,
}

var datas : TData = untyped JSon.decode(jsonString);

OR alternatively; is there another way to get directly decoded objects from URLRequest ?

Thanks!

Stephane


 
Reply | Threaded
Open this post in threaded view
|

Re: Json to Dynamic

Nemea Lion
Try Json2 on haxelib, that's what I use.

Carlos

2011/2/23 sledorze <[hidden email]>

I am accessing a web service on my server (in scala) from a flash client.
This web service returns a Json object.

Is there any good json decoding library that would decode directly into a
Dynamic object?
Meaning I could use my structural types on it.

type TData = {
       id : Int,
       type : String,
       category : String,
}

var datas : TData = untyped JSon.decode(jsonString);

OR alternatively; is there another way to get directly decoded objects from
URLRequest ?

Thanks!

Stephane



--
View this message in context: http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6056970.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Json to Dynamic

sledorze
You mean: http://lib.haxe.org/p/hxJson2
do you?

On Wed, Feb 23, 2011 at 5:53 PM, Nemea Lion [via Haxe] <[hidden email]> wrote:
Try Json2 on haxelib, that's what I use.

Carlos

2011/2/23 sledorze <[hidden email]>

I am accessing a web service on my server (in scala) from a flash client.
This web service returns a Json object.

Is there any good json decoding library that would decode directly into a
Dynamic object?
Meaning I could use my structural types on it.

type TData = {
       id : Int,
       type : String,
       category : String,
}

var datas : TData = untyped JSon.decode(jsonString);

OR alternatively; is there another way to get directly decoded objects from
URLRequest ?

Thanks!

Stephane



--
View this message in context: http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6056970.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6057036.html
To unsubscribe from Json to Dynamic, click here.



--
Stéphane Le Dorze

Tel: +33 (0) 6 08  76 70 15


Reply | Threaded
Open this post in threaded view
|

Re: Json to Dynamic

alexander.konotop
В Wed, 23 Feb 2011 09:22:27 -0800 (PST)
sledorze <[hidden email]> пишет:

>
> You mean: http://lib.haxe.org/p/hxJson2
> <http://lib.haxe.org/p/hxJson2>do you?
>
> On Wed, Feb 23, 2011 at 5:53 PM, Nemea Lion [via Haxe] <
> [hidden email]> wrote:
>
> > Try Json2 on haxelib, that's what I use.
> >
> > Carlos
> >
> > 2011/2/23 sledorze <[hidden
> > email]<http://user/SendEmail.jtp?type=node&node=6057036&i=0>
> > >
> >
> >>
> >> I am accessing a web service on my server (in scala) from a flash
> >> client. This web service returns a Json object.
> >>
> >> Is there any good json decoding library that would decode directly
> >> into a Dynamic object?
> >> Meaning I could use my structural types on it.
> >>
> >> type TData = {
> >>        id : Int,
> >>        type : String,
> >>        category : String,
> >> }
> >>
> >> var datas : TData = untyped JSon.decode(jsonString);
> >>
> >> OR alternatively; is there another way to get directly decoded
> >> objects from
> >> URLRequest ?
> >>
> >> Thanks!
> >>
> >> Stephane
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >> http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6056970.html<http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6056970.html?by-user=t>
> >> Sent from the Haxe mailing list archive at Nabble.com.
> >>
> >> --
> >> haXe - an open source web programming language
> >> http://haxe.org
> >>
> >
> >
> > --
> > haXe - an open source web programming language
> > http://haxe.org
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the
> > discussion below:
> > http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6057036.html
> >  To unsubscribe from Json to Dynamic, click
> > here<
> >
> >
>
>
>

I think, yes. I use hxJson2 too, it's perfect.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Json to Dynamic

sledorze
Yes, does the job ;)

Sent from my iPhone

On 23 févr. 2011, at 20:58, "Alexander Konotop [via Haxe]" <[hidden email]> wrote:

В Wed, 23 Feb 2011 09:22:27 -0800 (PST)
sledorze <[hidden email]> пишет:

>
> You mean: http://lib.haxe.org/p/hxJson2
> <http://lib.haxe.org/p/hxJson2>do you?
>
> On Wed, Feb 23, 2011 at 5:53 PM, Nemea Lion [via Haxe] <
> [hidden email]> wrote:
>
> > Try Json2 on haxelib, that's what I use.
> >
> > Carlos
> >
> > 2011/2/23 sledorze <[hidden
> > email]<http://user/SendEmail.jtp?type=node&node=6057036&i=0>
> > >
> >
> >>
> >> I am accessing a web service on my server (in scala) from a flash
> >> client. This web service returns a Json object.
> >>
> >> Is there any good json decoding library that would decode directly
> >> into a Dynamic object?
> >> Meaning I could use my structural types on it.
> >>
> >> type TData = {
> >>        id : Int,
> >>        type : String,
> >>        category : String,
> >> }
> >>
> >> var datas : TData = untyped JSon.decode(jsonString);
> >>
> >> OR alternatively; is there another way to get directly decoded
> >> objects from
> >> URLRequest ?
> >>
> >> Thanks!
> >>
> >> Stephane
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >> http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6056970.html<http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6056970.html?by-user=t>
> >> Sent from the Haxe mailing list archive at Nabble.com.
> >>
> >> --
> >> haXe - an open source web programming language
> >> http://haxe.org
> >>
> >
> >
> > --
> > haXe - an open source web programming language
> > http://haxe.org
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the
> > discussion below:
> > http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6057036.html
> >  To unsubscribe from Json to Dynamic, click
> > here<
> >
> >
>
>
>

I think, yes. I use hxJson2 too, it's perfect.

--
haXe - an open source web programming language
http://haxe.org



If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/Json-to-Dynamic-tp6056970p6057649.html
To unsubscribe from Json to Dynamic, click here.