Json parser pharo 2.0

I am working with a web service that returns data in JSON format, and I'm pretty new to Pharo 2.0

¿Is there a good, simple, and most reliable JSON parser?

I saw an example of a JSON parser using PetitParser in the book Faro Example 2 (deep in pharo), but I don’t know if this is just an illustrative example or something fully functional.

+4
source share
4 answers

You just need to take a look at NeoJSON . This is the best I know at Pharo for working with JSON.

+5
source

I don't know NeoJSON, but it works great: http://smalltalkhub.com/#!/~PharoExtras/JSON

+2

, PetitJSON (, , )

+2

I know this question is several years old and relates to Pharo 2, but in the current version of Pharo (6.1) there is a STONJSON class in the STON-Core package, which simplifies reading and writing data from JSON strings or streams:

| dict |

dict := STONJSON fromString: '
{ 
  "flow": "milk",
  "amount": 42.0
}'.
Transcript show: ( STONJSON toStringPretty: dict ).
0
source

All Articles