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: #AsString.
  ].

  mapper for: #AsString customDo: [ :mapping |
    mapping encoder: [ :anInteger | x asString ].
    mapping decoder: [ :aString | ... ] ].

But whatever I do ... only numbers are written out ... and yes of course
I could add additional accessors doing the conversion.

-- 
Marten Feldtmann

Reply via email to