Re: [Pharo-users] neo json and valueSchema for integer attributes ...

2014-03-24 Thread Sven Van Caekenberghe
Hi Marten, It took a while, but I implemented a new feature that should solve your issue. You can now do the following: String streamContents: [ :out | (NeoJSONWriter on: out) for: #StringAsHex customDo: [ :mapping | mapping encoder: [ :x | x asByteArray hex asUppercase ];

Re: [Pharo-users] neo json and valueSchema for integer attributes ...

2014-02-21 Thread Sven Van Caekenberghe
Hi Marten, There is indeed something currently not completely implemented: #valueSchema: and #nextAs: were added afterwards for reading (for example a collection of Points), the use of this concept for writing is simply not there. (compare NeoJSONPropertyMapping>>#readObject:from: to NeoJSONPr

Re: [Pharo-users] neo json and valueSchema for integer attributes ...

2014-02-21 Thread itli...@schrievkrom.de
Hmm, I think that something is definitly missing here. The same code but instead of using #AsString I use DateAndTime and it works as expected - and that's what I would expect: use for that property mapping a valueSchema named "AsString". It seems to work for all classes, when there is no predefi

Re: [Pharo-users] neo json and valueSchema for integer attributes ...

2014-02-21 Thread Sven Van Caekenberghe
On 21 Feb 2014, at 09:18, Norbert Hartl wrote: > Am 21.02.2014 um 07:50 schrieb itli...@schrievkrom.de: > >> I have a class with an instance attribute "x" and this one contains an >> integer value. >> >> No when exporting this to json I want to write a string instead of this >> number to the j

Re: [Pharo-users] neo json and valueSchema for integer attributes ...

2014-02-21 Thread Norbert Hartl
Am 21.02.2014 um 07:50 schrieb itli...@schrievkrom.de: > I have a class with an instance attribute "x" and this one contains an > integer value. > > No when exporting this to json I want to write a string instead of this > number to the json string ... > > neoJsonMapping: mapper > mapper for:

[Pharo-users] neo json and valueSchema for integer attributes ...

2014-02-20 Thread itli...@schrievkrom.de
I have a class with an instance attribute "x" and this one contains an integer value. No when exporting this to json I want to write a string instead of this number to the json string ... neoJsonMapping: mapper mapper for: self do: [ :mapping | (mapping mapInstVar: #x to: 'x') valueSchema: