Open stiefeljackal opened 10 months ago
Looked into this today with the flurry of other activity. One of the problems here is that there are some elements in the Elements.Core base structs that need to be tweaked.
Those elements can't easily be bi-directionally serialized to JSON and that's what the schema generator does as part of its process.
The bi-directional issues are due to multi-dimensional number types(float3, etc), being implemented in a specific way in Elements.Core's type generator. The type generator uses, [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
from NewtonSoft, but there is no System.Text.Json equivalent of that.
Which leads to every single property of those types being serialized.
These types are very complicated and so that leads to duplicate JSON Properties, which explodes most of the Json stack.
So we need opt-in support for System.Text.Json...
So some research later:
We'll have to write our own JSON Contract Modifier to handle this or find one \o/
Or of course we just mark the problematic elements with JsonIgnore which is easier!
Since creating an animation with AnimJ requires importing a JSON file (hence the letter "J" at the end of AnimJ), it would be great if that schema was present here as well. You should be able to generate the schema from the class files like you do for the Headless and Client config.