Skip to content

Commit

Permalink
JSON: fix incorrect raw string for object with string value
Browse files Browse the repository at this point in the history
Ary Borenszweig committed Jun 3, 2016

Verified

This commit was signed with the committer’s verified signature. The key has expired.
vbgl Vincent Laporte
1 parent ab0cade commit 5c49190
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions spec/std/json/pull_parser_spec.cr
Original file line number Diff line number Diff line change
@@ -303,5 +303,6 @@ describe JSON::PullParser do
assert_raw %("hello")
assert_raw %([1,"hello",true,false,null,[1,2,3]])
assert_raw %({"foo":[1,2,{"bar":[1,"hello",true,false,1.5]}]})
assert_raw %({"foo":"bar"})
end
end
2 changes: 1 addition & 1 deletion src/json/pull_parser.cr
Original file line number Diff line number Diff line change
@@ -167,8 +167,8 @@ class JSON::PullParser
first = true
while kind != :end_object
io << "," unless first
read_object_key
@string_value.to_json(io)
read_object_key
io << ":"
read_raw(io)
first = false

0 comments on commit 5c49190

Please sign in to comment.