Re: [Pharo-users] nested json problem

2018-11-05 Thread Roelof Wobben
Problem has solved. I had the instance variable to   instance := self new. instead of instance := self basicNew. Roelof Op 5-11-2018 om 22:50 schreef Sven Van Caekenberghe: On 5 Nov 2018, at 22:41, Roelof Wobben wrote: I use this code to try to read things: json paintingCollection |

Re: [Pharo-users] nested json problem

2018-11-05 Thread Sven Van Caekenberghe
> On 5 Nov 2018, at 22:41, Roelof Wobben wrote: > > I use this code to try to read things: > > json paintingCollection | > json := (NeoJSONReader fromString: (ZnEasy get: ' > https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak&format=json&type=schilderij&toppieces=True > ') contents).

Re: [Pharo-users] nested json problem

2018-11-05 Thread Roelof Wobben
I use this code to try to read things: json paintingCollection | json := (NeoJSONReader fromString: (ZnEasy get: 'https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak&format=json&type=schilderij&toppieces=True') contents). paintingCollection := PaintingCollectio

Re: [Pharo-users] nested json problem

2018-11-05 Thread Erik Stel
Roelof, What does not work in your code? How do you call PaintingCollection>>fromJSON: ? >From what I see this code could work if used like (replace URL with actual URL): -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Re: [Pharo-users] nested json problem

2018-11-05 Thread Sven Van Caekenberghe
Hi/Dag Roelof, In a first approach I would not start by trying to map to actual domain objects (you can do that later), I would start by using NeoJSONObject, which is quite flexible and user friendly. Consider the following example: (NeoJSONObject fromString: '{ "elapsedMilliseconds": 164,

[Pharo-users] nested json problem

2018-11-05 Thread Roelof Wobben
Hello, I try to use the rijksmuseum api. This gives json back for 10 paintings and the json looks like this : { "elapsedMilliseconds": 164, "count": 359, "artObjects": [ { "links": { "self": "https://www.rijksmuseum.nl/api/nl/co