On Fri, Jul 24, 2009 at 8:57 PM, fbettag fr...@bett.ag wrote:
Still one problem when parsing:
results: {name:New Content,language:en,content:,layout:
22}
java.lang.NumberFormatException: For input string: 22.0
at java.lang.NumberFormatException.forInputString
David Pollak feeder.of.the.be...@gmail.com writes:
You can use:
Box.asA[Map[String, _]](in) which will return Full(in) if in is a
Map[String, _] or Empty if it's not. This helps in for comprehensions.
Ah, didn't know that. Very nice!
/Jeppe
You can use:
Box.asA[Map[String, _]](in) which will return Full(in) if in is a
Map[String, _] or Empty if it's not. This helps in for comprehensions.
On Wed, Jul 15, 2009 at 12:00 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:
On Wed, Jul 15, 2009 at 11:27 AM, fbettagfr...@bett.ag wrote:
I just noticed i forgot a } after 'baz' ;)
Thanks for your replies
On Jul 14, 6:59 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
fbettag fr...@bett.ag writes:
Heyho,
any ideas how i can parse data that was posted as JSON?
For example:
{foo: [{bar: 'shiz'}, {bar: 'baz']}
The above
Ok, i found out that the POSTed JSON was in S.params(results).first,
which contains:
Full(Map(name - New Content, language - en, content - , id - ext-
record-1))
So i tried this:
for ((key, value) - JSONParser.parse(S.params(results).first)) {
Log.error(key + - +
Any variation i try gives me:
(key, value) - res
value filter is not a member of Any
On Jul 15, 11:22 am, marius d. marius.dan...@gmail.com wrote:
Try using for comprehensions
for (res - JSONParser.parse(S.params(results).first);
(key, value) - res) yield some_expression
Marius
On Wed, Jul 15, 2009 at 11:27 AM, fbettagfr...@bett.ag wrote:
Any variation i try gives me:
(key, value) - res
value filter is not a member of Any
Ahh yes, JSONParser.parse returns Box[Any] since the result can be
either a list or a map. Still, you can do it like this
for (res -