Reputation: 43
I'm working with a webservice that returns data in JSON format and i'm pretty new at Pharo 2.0
¿is there a good, simple and most of all reliable JSON parser?
I saw the JSON parser example using PetitParser in the book "Pharo by example 2" (deep into pharo) but i don't know if it's just an illustrative example or something fully functional.
Upvotes: 4
Views: 1245
Reputation: 5062
I know this question is some years old and relates to Pharo 2 but in the current version of Pharo (6.1) there is a class STONJSON in the STON-Core package which makes it easy to read and write data from and to JSON strings or streams:
| dict |
dict := STONJSON fromString: '
{
"flow": "milk",
"amount": 42.0
}'.
Transcript show: ( STONJSON toStringPretty: dict ).
Upvotes: 0
Reputation: 4357
both works, and also PetitJSON (no, it was not an example, is fully operational)
Upvotes: 2
Reputation: 2589
I don't know NeoJSON, but this one works great: http://smalltalkhub.com/#!/~PharoExtras/JSON
Upvotes: 2