Description
Describe the bug
I know the C# k8s client has been working to get compatible with source trimming. I tried to get Json serialization working, but get this error at compile time:
The 'JsonConverterAttribute' type 'k8s.Models.IntOrStringJsonConverter' specified on member 'k8s.Models.IntstrIntOrString' is not a converter type or does not contain an accessible parameterless constructor.
Kubernetes C# SDK Client Version
13.0.11
Dotnet Runtime Version
net6
To Reproduce
This snippet is enough for me to hit the warning along with adding <IsTrimmable>true</IsTrimmable>
to my library project
using System.Text.Json.Serialization;
using k8s.Models;
namespace MyApp;
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(IntstrIntOrString))]
internal partial class MyAppJsonContext : JsonSerializerContext
{
}
Expected behavior
This shouldn't raise an error. InOrStringJsonConverter is internal so making it public would likely fix the issue, but I'll leave that up to you if that's the best fix or not.