[Pharo-users] How to write out simple Json?

Tim Mackinnon tim at testit.works
Thu Feb 28 08:05:10 EST 2019


I am stumped about how to write out some simple json (for a config file). I didn't think I need Neo, and STONJSON would be fine but it seems like creating items like: 

{ 'id'-> self id. 'name' -> self name }

gives an error about the association. I think you have to do: { ('id'-> self id) asDictionary. ('name' -> self name) asDictionary } everywhere….

But when I switch over to NeoJsonWriter it also complains about Assocations too. I just want a simple output like:
{ "id" : 12, "name" : "tim” }

I thought it was simple to do this? Am I missing something obvious.

Tim


More information about the Pharo-users mailing list