-
Notifications
You must be signed in to change notification settings - Fork 39
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
Simplify the api #30
Comments
Pain points from related issues:
var depots = data["Software"]["Valve"]["Steam"]["depots"];
foreach (var depot in (IEnumerable<KVObject>)depots)
{
Console.WriteLine(depot.Name);
}
List<KVObject> collection = ((KVCollectionValue)app.Data["config"]["launch"]).children; which is just awful from a consumer POV, even though it works (with Feel free to add more. |
I am not sure what we are gaining from having it be immutable. I'd throw in that |
IMO most of the time we're just reading Valve's stuff, so we don't typically need to mutate it. Though another way of looking at it would be - if you want immutable types, deserialise it to an immutable type. (We might need to add support for records / What does |
Fortunately, records already work. I've added a test for them in ed10cc1. |
I do sometimes.
Literal |
Another annoyance I'm running into: KVObject["str"] returns KVValue, but the underlying type is a private KVObjectValue, so I can't cast the KVValue back into KVObject. And KVObject doesn't extend KVValue, so this seems very inconsistent. This doesn't matter for this[] accessor as it's implemented on both, but if you want to pass around the objects, this gets messy. Are consumers only ever expected to cast any value into KVValue, but internally we create KVObjectValue with types? I've been trying to convert VRF to use VKV's types, and it's very painful. |
The text was updated successfully, but these errors were encountered: