Skip to content

Commit fb6c551

Browse files
committed
Special case serialization of V1Patch
1 parent 4438daa commit fb6c551

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/KubernetesClient.Aot/KubernetesJson.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ public static TValue Deserialize<TValue>(Stream json, JsonSerializerOptions json
9191

9292
public static string Serialize(object value, JsonSerializerOptions jsonSerializerOptions = null)
9393
{
94+
if (value is V1Patch { Content: string jsonValue })
95+
{
96+
return jsonValue;
97+
}
98+
9499
var info = SourceGenerationContext.Default.GetTypeInfo(value.GetType()) ?? LocalSgContext.Default.GetTypeInfo(value.GetType());
95100
return JsonSerializer.Serialize(value, info);
96101
}

0 commit comments

Comments
 (0)