Closed eed3si9n closed 7 years ago
Wouldn't this mean that case classes are encoded as an array of name/value pairs?
Ie a JSON array of JSON objects?
I thought of a workaround that's not so ugly. Just persist the field order as "$fields".
Just for clarity you mean LList would serialise a class to a JSON object, with an additional synthetic "$fields" field, which is a JSON array of the field names (strings), in the order the fields were defined?
Yea, that can get natural looking JObject without relying on the insertion order.
Although I personally think AST should be able to roundtrip from source, we can't assume insertion order to be preserved by various AST implementations. As such LList encoding should probably use JArray.