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.
Description
Description
Details
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
Comment Actions
Hello ghassani and thank you for the report.
We are going to look into the issue and see what can be done.
Regards,
Geez