You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removing the space between "sys.module.Pos": and following { solves the issue.
Expected behavior
White space in json shouldn't cause a parsing error.
Additional context
I tried to reproduce this with the flecs::entity.from_json() call but I couldn't, so this issue might be specific to flecs::world.from_json().
The json exported by to_json() does not add this space of course, but using a json library to parse and edit some value may reformat the json leading to some unanticipated whitespace when converting json back to string.
The text was updated successfully, but these errors were encountered:
Are you able to share the component type + reflection code you've used for this? I cannot reproduce this when I create a type with a pos member that is of a type with x, y, z members.
I do get this error when the type does not match the JSON, in which case I get
error: cursor.c: 305: unknown member 'pos' for type 'T'
error: 1: expected }, got ]
{"results":[{"name":"e", "id":1000,"components":{"T": {"pos":{"x":10, "y":20}}}}]}
That's not a bug though, the input is not valid in this case.
Describe the bug
Json parser error when calling:
flecs::world.from_json()
because of a specific space char between key/value.To Reproduce
Call
flecs::world.from_json()
on this json ("Pos" assumed to be a predefined component):And this is the error I get:
Removing the space between
"sys.module.Pos":
and following{
solves the issue.Expected behavior
White space in json shouldn't cause a parsing error.
Additional context
I tried to reproduce this with the
flecs::entity.from_json()
call but I couldn't, so this issue might be specific toflecs::world.from_json()
.The json exported by
to_json()
does not add this space of course, but using a json library to parse and edit some value may reformat the json leading to some unanticipated whitespace when converting json back to string.The text was updated successfully, but these errors were encountered: