Skip to content

Commit

Permalink
Bump YamlDotNet from 15.3.0 to 16.0.0 (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Jul 15, 2024
1 parent e14c9e4 commit d6d1b9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DicomTypeTranslation/DicomTypeTranslation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
<PackageReference Include="MongoDB.Driver" Version="2.27.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="YamlDotNet" Version="15.3.0" />
<PackageReference Include="YamlDotNet" Version="16.0.0" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions DicomTypeTranslation/TableCreation/SystemTypeTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@

namespace DicomTypeTranslation.TableCreation;

internal class SystemTypeTypeConverter : IYamlTypeConverter
internal sealed class SystemTypeTypeConverter : IYamlTypeConverter
{
public bool Accepts(Type type)
{
return typeof(Type).IsAssignableFrom(type);
}

public object ReadYaml(IParser parser, Type type)
public object ReadYaml(IParser parser, Type type, ObjectDeserializer _)
{
var scalar = parser.Consume<Scalar>();
return Type.GetType(scalar.Value);
}

public void WriteYaml(IEmitter emitter, object value, Type type)
public void WriteYaml(IEmitter emitter, object value, Type _1, ObjectSerializer _2)
{
var typeName = ((Type)value).FullName;
var typeName = (value as Type)?.FullName ?? throw new ArgumentException("SytemTypeTypeConverter.WriteYaml called with non-Type argument",nameof(value));
emitter.Emit(new Scalar(typeName));
}
}

0 comments on commit d6d1b9f

Please sign in to comment.