Skip to content

Commit

Permalink
fix: suppress warnings
Browse files Browse the repository at this point in the history
Signed-off-by: MTsfoni <[email protected]>
  • Loading branch information
mtsfoni committed Sep 16, 2024
1 parent b3ed80e commit 82abfd6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cyclonedx/Serialization/CsvSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is part of CycloneDX CLI Tool
// This file is part of CycloneDX CLI Tool
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -76,7 +76,9 @@ public static string Serialize(Bom bom)
csv.WriteField(c.Type);
csv.WriteField(c.MimeType);
csv.WriteField(c.Supplier?.Name);
#pragma warning disable CS0618 // Type or member is obsolete
csv.WriteField(c.Author);
#pragma warning restore CS0618 // Type or member is obsolete
csv.WriteField(c.Publisher);
csv.WriteField(c.Group);
csv.WriteField(c.Name);
Expand Down Expand Up @@ -151,6 +153,7 @@ public static Bom Deserialize(string csv)
csvReader.ReadHeader();
while (csvReader.Read())
{
#pragma warning disable CS0618 // Type or member is obsolete
var component = new Component
{
Type = csvReader.GetField<Component.Classification?>("Type") ?? Component.Classification.Library,
Expand Down Expand Up @@ -190,6 +193,7 @@ public static Bom Deserialize(string csv)
// external references not supported
// sub-components not supported
};
#pragma warning restore CS0618 // Type or member is obsolete
if (component.Supplier.Name == null) component.Supplier = null;
if (component.Swid.Text.Content == null) component.Swid.Text = null;
if (component.Swid.TagId == null) component.Swid = null;
Expand Down

0 comments on commit 82abfd6

Please sign in to comment.