crystal-by-example icon indicating copy to clipboard operation
crystal-by-example copied to clipboard

Example JSON

Open Ivo-Balbaert opened this issue 7 years ago • 1 comments

result = String.build do |io| io.json_object do |object| object.field "address", "Crystal Road 1234" object.field "location" do io.json_array do |array| array << 12.3 array << 34.5 end end end end

Error: undefined method json_object for String::Builder

Ivo-Balbaert avatar Mar 08 '17 14:03 Ivo-Balbaert

This doesn't seem to relevant anymore as the original example has been changed: https://github.com/askn/crystal-by-example/blob/aab909a613ba72c0b021d9d024e59a839a5122fd/json/json.cr#L13-L23

firoxer avatar Oct 09 '18 17:10 firoxer