Open SGStino opened 1 month ago
seems so, would you like to send a pr to fix it? or i will pick it this weekend
We could pick it up, but, at first glance I don't really see where that would be done in YamlDotNet. There doesn't seem to be a serialization context like in System.Text.Json? Any suggestion as to where to look? Haven't done any AOT with Yaml so far yet.
It seems that all the YamlSerializeableAttribute
s aren't required on the StaticContext and that it still works for most of the types.
But adding [YamlSerializeableAttribute(typeof(IList<string>))]
makes the Source generator generate invalid code and it won't compile anymore.
only [YamlSerializeableAttribute(typeof(string[])]
generates code that compiles, but that would require updating the kubernetes client models, which wouldn't be desirable...
It might be related to https://github.com/aaubry/YamlDotNet/issues/740#issuecomment-1360163696
And if i'm reading this: https://github.com/aaubry/YamlDotNet/issues/884 it might fix itself in a few days.
Describe the bug If a kubernetes client config contains string lists (for example, at users[*].user.exec.args), the yaml serializer throws that it can't deserialize the node into IList.
Kubernetes C# SDK Client Version
14.0.2
Server Kubernetes Version
N\A
Dotnet Runtime Version
net8
To Reproduce Create a config that contains a user that needs to "exec" with arguments, for example kube oidc login (see KubeConfig)
Expected behavior Being able to deserialize the config, including the args list.
KubeConfig
Where do you run your app with Kubernetes SDK (please complete the following information): Reproducable in RoslynPad or dotnet console application:
Additional context in the JsonSerializationContext for AOT source generation you'd have to include
[JsonSerializable(typeof(IList<string>))]
, my guess would be that there is something similar for YamlDotNet?