Neko| cant access to Json child

30 views
Skip to first unread message

michael solomon

unread,
Oct 31, 2015, 6:51:41 PM10/31/15
to Haxe
Hi,
I'm trying to parse Json and iterate over his child, anybody know why it's happen?
this is the "fields" section in my JSON file:

"fields": {
       
"code": {
           
"title": "title",
           
"length": "4"
       
},
       
"recordNum": {
           
"title": "title",
           
"length": "9"
       
},
       
....
       
.....
}



Juraj Kirchheim

unread,
Oct 31, 2015, 7:16:24 PM10/31/15
to haxe...@googlegroups.com
That's because the actual runtime value of `fields` is not a `Map<String, Field>` but rather `haxe.DynamicAccess<Field>`. I believe we already had a conversation or two about this, but if you need clarification, let us know ;)

Best,
Juraj

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

michael solomon

unread,
Nov 1, 2015, 4:07:15 PM11/1/15
to Haxe
Lol, yes you're right! we did this conversation before :) but I forgot the magic word to solve that!
Is there a way that I can to avoid from using Reflect for iterate over this Json?
Btw: what the difference between Map<String, XXX> to DynamicAccess<XXX> ?
Thanks,
Reply all
Reply to author
Forward
0 new messages