« Return to Thread: Doing a recursive JSON.readFull

Re: Doing a recursive JSON.readFull

by Mario Camou :: Rate this Message:

Reply to Author | View in Thread

Thanks for the quick answer! I'll have a look at it. I thought Twitter's implementation was similar to the one included in the Scala libs.

I'll probably end up using it since I assume it's quite well tested, although I'll roll my own as an exercise.

Thanks again!
-Mario.

--
I want to change the world but they won't give me the source code.


On Sun, Jul 5, 2009 at 23:28, Lincoln <linxbetter@...> wrote:
I have used Twitter's implementation.  It's worked well for me and
does what I think you're looking for.

You can find it here: http://github.com/stevej/scala-json/tree/master.

Lincoln

On Sun, Jul 5, 2009 at 5:20 PM, Mario Camou<mcamou@...> wrote:
> Hi all,
> I need to read some JSON data from a server. I need the data to be parsed
> into Maps of Lists of Maps (or Maps of Maps, or Lists of Lists of Maps, you
> get the idea). I was going through the scaladocs for the Scala library and
> found scala.util.parsing.json.JSON.parseFull, whose docs state that it
> "Parse the given JSON string and return either a List[Any] if the JSON
> string specifies an Array, or a Map[String,Any] if the JSON string specifies
> an object". I thought that was just what I needed, but it turns out it works
> only for the first level, and it leaves any lower structures as lists of
> pairs instead of Maps.
> Has anyone here worked with a JSON parser that does what I need? I can
> always write a method to convert from one representation to the other, but I
> thought I'd ask around first.
> Now that I think about it, I'll probably have to go with a Java library or
> build my own, since I actually need the Lists and Maps to be the Java
> variants (since I'm going to have to pass them to JRuby).
> Any ideas?
> Thanks,
> -Mario.
>
> --
> I want to change the world but they won't give me the source code.
>

 « Return to Thread: Doing a recursive JSON.readFull