Skip to content

Commit

Permalink
feat: yamldotnet 16 support (#1574)
Browse files Browse the repository at this point in the history
* feat: yamldotnet 16 support

* update yamldotnet

* fix interface

* update Vecc.YamlDotNet.Analyzers.StaticGenerator
  • Loading branch information
IvanJosipovic authored Aug 11, 2024
1 parent e05bc14 commit 36a0204
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="20.0.15" />
<PackageVersion Include="System.Reactive" Version="6.0.0" />
<PackageVersion Include="System.Text.Json" Version="7.0.3" />
<PackageVersion Include="Vecc.YamlDotNet.Analyzers.StaticGenerator" Version="13.7.0" />
<PackageVersion Include="Vecc.YamlDotNet.Analyzers.StaticGenerator" Version="16.0.0" />
<PackageVersion Include="xunit" Version="2.6.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
<PackageVersion Include="YamlDotNet" Version="15.1.0" />
<PackageVersion Include="YamlDotNet" Version="16.0.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Autofac" Version="8.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/KubernetesClient.Aot/KubernetesYaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public bool Accepts(Type type)
return type == typeof(byte[]);
}

public object ReadYaml(IParser parser, Type type)
public object ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer)
{
if (parser?.Current is Scalar scalar)
{
Expand All @@ -67,7 +67,7 @@ public object ReadYaml(IParser parser, Type type)
throw new InvalidOperationException(parser.Current?.ToString());
}

public void WriteYaml(IEmitter emitter, object value, Type type)
public void WriteYaml(IEmitter emitter, object value, Type type, ObjectSerializer serializer)
{
var obj = (byte[])value;
emitter?.Emit(new Scalar(Encoding.UTF8.GetString(obj)));
Expand Down
4 changes: 2 additions & 2 deletions src/KubernetesClient/KubernetesYaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public bool Accepts(Type type)
return type == typeof(byte[]);
}

public object ReadYaml(IParser parser, Type type)
public object ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer)
{
if (parser?.Current is Scalar scalar)
{
Expand All @@ -89,7 +89,7 @@ public object ReadYaml(IParser parser, Type type)
throw new InvalidOperationException(parser.Current?.ToString());
}

public void WriteYaml(IEmitter emitter, object value, Type type)
public void WriteYaml(IEmitter emitter, object value, Type type, ObjectSerializer serializer)
{
var obj = (byte[])value;
emitter?.Emit(new Scalar(Encoding.UTF8.GetString(obj)));
Expand Down
4 changes: 2 additions & 2 deletions src/KubernetesClient/Models/IntOrStringYamlConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public bool Accepts(Type type)
return type == typeof(IntstrIntOrString);
}

public object ReadYaml(IParser parser, Type type)
public object ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer)
{
if (parser?.Current is YamlDotNet.Core.Events.Scalar scalar)
{
Expand All @@ -32,7 +32,7 @@ public object ReadYaml(IParser parser, Type type)
throw new InvalidOperationException(parser?.Current?.ToString());
}

public void WriteYaml(IEmitter emitter, object value, Type type)
public void WriteYaml(IEmitter emitter, object value, Type type, ObjectSerializer serializer)
{
var obj = (IntstrIntOrString)value;
emitter?.Emit(new YamlDotNet.Core.Events.Scalar(obj?.Value));
Expand Down
5 changes: 2 additions & 3 deletions src/KubernetesClient/Models/ResourceQuantityYamlConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public bool Accepts(Type type)
return type == typeof(ResourceQuantity);
}

public object ReadYaml(IParser parser, Type type)
public object ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer)
{
if (parser?.Current is YamlDotNet.Core.Events.Scalar scalar)
{
Expand All @@ -32,8 +32,7 @@ public object ReadYaml(IParser parser, Type type)
throw new InvalidOperationException(parser?.Current?.ToString());
}


public void WriteYaml(IEmitter emitter, object value, Type type)
public void WriteYaml(IEmitter emitter, object value, Type type, ObjectSerializer serializer)
{
var obj = (ResourceQuantity)value;
emitter?.Emit(new YamlDotNet.Core.Events.Scalar(obj?.ToString()));
Expand Down

0 comments on commit 36a0204

Please sign in to comment.