Re: [Pharo-users] Question about NeoJSON

2015-03-13 Thread Mariano Martinez Peck
On Thu, Mar 12, 2015 at 6:19 PM, Esteban A. Maringolo wrote: > 2015-03-12 17:22 GMT-03:00 Mariano Martinez Peck : > > On Thu, Mar 12, 2015 at 5:16 PM, Esteban A. Maringolo < > emaring...@gmail.com> > > wrote: > > >> Assuming you store the original JSON string as a String object in an > >> instanc

Re: [Pharo-users] Question about NeoJSON

2015-03-13 Thread Mariano Martinez Peck
On Thu, Mar 12, 2015 at 6:09 PM, Sven Van Caekenberghe wrote: > I don't really understand why you want to keep the original JSON. It is a > bit like you don't trust the parsing and/or mapping. Now, the mapping I > understand (somewhat). > > Yes, there are a few domain-specific reasons, but let me

Re: [Pharo-users] Question about NeoJSON

2015-03-12 Thread Esteban A. Maringolo
2015-03-12 18:09 GMT-03:00 Sven Van Caekenberghe : > I don't really understand why you want to keep the original JSON. It is a bit > like you don't trust the parsing and/or mapping. Now, the mapping I > understand (somewhat). I guess this has to do with the fact that if you have a REST+JSON API

Re: [Pharo-users] Question about NeoJSON

2015-03-12 Thread Esteban A. Maringolo
2015-03-12 17:22 GMT-03:00 Mariano Martinez Peck : > On Thu, Mar 12, 2015 at 5:16 PM, Esteban A. Maringolo > wrote: >> Assuming you store the original JSON string as a String object in an >> instance variable named "json" you could map it as any other string. > But how do I get the JSON string a

Re: [Pharo-users] Question about NeoJSON

2015-03-12 Thread Sven Van Caekenberghe
I don't really understand why you want to keep the original JSON. It is a bit like you don't trust the parsing and/or mapping. Now, the mapping I understand (somewhat). So I would parse once without mapping, which would give you pure Arrays and Dictionaries that you are guaranteed can be used t

Re: [Pharo-users] Question about NeoJSON

2015-03-12 Thread Mariano Martinez Peck
On Thu, Mar 12, 2015 at 5:32 PM, Sven Van Caekenberghe wrote: > Mariano, > > I assume you what this while reading JSON. That won't be possible. NeoJSON > is designed as an efficient stream parser, working as it goes. So it never > knows the whole JSON expression. > U I imagined that :( > >

Re: [Pharo-users] Question about NeoJSON

2015-03-12 Thread Sven Van Caekenberghe
Mariano, I assume you what this while reading JSON. That won't be possible. NeoJSON is designed as an efficient stream parser, working as it goes. So it never knows the whole JSON expression. I would do it manually, but that can only be done at the top level. Sven > On 12 Mar 2015, at 21:22,

Re: [Pharo-users] Question about NeoJSON

2015-03-12 Thread Mariano Martinez Peck
On Thu, Mar 12, 2015 at 5:16 PM, Esteban A. Maringolo wrote: > Assuming you store the original JSON string as a String object in an > instance variable named "json" you could map it as any other string. > > But how do I get the JSON string associated to the TestObject instance? In other words...

Re: [Pharo-users] Question about NeoJSON

2015-03-12 Thread Esteban A. Maringolo
Assuming you store the original JSON string as a String object in an instance variable named "json" you could map it as any other string. Or are you planning to store it as JSON object itself? Esteban A. Maringolo 2015-03-12 16:50 GMT-03:00 Mariano Martinez Peck : > Hi, > > In this link: > https

[Pharo-users] Question about NeoJSON

2015-03-12 Thread Mariano Martinez Peck
Hi, In this link: https://github.com/svenvc/docs/blob/master/neo/neo-json-paper.md I see an example of a custom mapping like this one: mapper for: TestObject do: [ :mapping | mapping mapInstVars: #(id name). (mapping mapInstVar: #timestamp to: 'created-at') valueSchema: DateAndTime.