Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No closing } for object; context = <{>for valid JSON when using fsJsonPrinter.PrettyJson #160

Open
tylkomat opened this issue Mar 18, 2020 · 1 comment

Comments

@tylkomat
Copy link

tylkomat commented Mar 18, 2020

Looks like the fsJsonParser cannot parse pretty printed JSON.

I reduced my class to a bare minimum to test this issue.

public class Test {
  public Vector3 test
}

This is the resulting json, which is valid

{
    "test": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    }
}

This is the error I get from the parser.

Exception: Error while parsing: No closing } for object; context = <{>
FullSerializer.fsResult.AssertSuccess () (at Assets/FullSerializer/Source/fsResult.cs:147)
FullSerializer.fsJsonParser.Parse (System.String input) (at Assets/FullSerializer/Source/fsJsonParser.cs:495)

Everything works fine with when using fsJsonPrinter.CompressedJson.
Could this be an issue with line endings?

@tylkomat
Copy link
Author

Using the debugger to step though the SkipSpace function I noticed that the parser stops right after the first opening bracket. So definitely line breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant