Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump YamlDotNet from 15.3.0 to 16.0.0 #281

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
}
}