mirror of
https://github.com/halaxa/json-machine.git
synced 2025-03-15 17:09:39 +01:00
Merge pull request #42 from halaxa/fix-41
Incomplete JSON buffer after composite value containing an empty dict fixed
This commit is contained in:
commit
6bc53a05e6
@ -194,6 +194,7 @@ class Parser implements \IteratorAggregate, PositionAware
|
||||
$expectedType = 55; // 55 = self::AFTER_ARRAY_START;
|
||||
continue 2; // valid json chunk is not completed yet
|
||||
case '}':
|
||||
$objectKeyExpected = false;
|
||||
case ']':
|
||||
--$currentLevel;
|
||||
$inObject = $stack[$currentLevel] === '{';
|
||||
|
@ -56,6 +56,7 @@ class ParserTest extends \PHPUnit_Framework_TestCase
|
||||
['/0/0', '[{"0":{"c":1,"d":2}}]', ['c'=>1,'d'=>2]],
|
||||
['/1/1', '[0,{"1":{"c":1,"d":2}}]', ['c'=>1,'d'=>2]],
|
||||
'PR-19-FIX' => ['/datafeed/programs/1', file_get_contents(__DIR__.'/PR-19-FIX.json'), ['program_info'=>['id'=>'X1']]],
|
||||
'ISSUE-41-FIX' => ['/path', '{"path":[{"empty":{}},{"value":1}]}', [["empty"=>[]],["value"=>1]]],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user