Page MenuHomeFeedback Tracker

JsonSerializer errors on blank lines
Closed, ResolvedPublic

Description

When reading json input into the serializer, it fails on an empty line saying it was expecting a key, or object depending on the context.

Details

Severity
Trivial
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Engine
Steps To Reproduce

Create a json file or string with an extra line break between two key value pairs, or between two objects in an array of objects produces the same type of error.

{
	"foo": "bar",

	"bar": "baz"
}

Create a test object to read the data into and read in the file.

class TestJson
{
	string foo;
	string bar;
}

ref TestJson test = new TestJson();

JsonFileLoader<ref TestJson>.JsonLoadFile( "$profile:test.json", test );

Load the json file (or directly use the serializer produces the same error)

Will trigger an error along the lines of expecting a string key, or expecting an object.

A quick fix in JsonLoadFile can be to skip over empty lines, but should probably be addressed in JsonSerializer.

Event Timeline

ghassani created this task.Jan 29 2019, 8:35 PM
ghassani edited Steps To Reproduce. (Show Details)
Geez changed the task status from New to Assigned.Jan 30 2019, 5:17 PM
Geez changed the task status from Assigned to Acknowledged.Feb 4 2019, 2:06 PM
Geez added a subscriber: Geez.

Hello ghassani and thank you for the report.
We are going to look into the issue and see what can be done.
Regards,
Geez

Geez closed this task as Resolved.Sep 5 2019, 3:19 PM
Geez claimed this task.