Yes, I find out that.
But I wanted to have the JSON serialization to be context-dependant.

And that's what I achieved by means of the custom mappings.

Again, kudos for making it so fast and memory-savvy, being stream based with
no internal transformations makes it almost a basic printOn: aStream.

One question that remains is... how to map the same accesor/instVar to more
than one attribute.
eg.
neoJsonMapping: mapper

  mapper for: self do: [:mapping |
    mapping mapAccessor: #reference. "full"
    (mapping mapAccessor: #reference to: 'reference-id) valueSchema:
#ReferenceId "just its ID"
  ].

   mapper for: #ReferenceId customDo: [:mapping |
      mapper encoder: [:obj | obj id printString ]
      "..."
   ]

If I do that, I end up having the full reference twice.


Regards!




--
View this message in context: 
http://forum.world.st/NeoJSON-Mappings-tp4677077p4677288.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to