From 82abfd67836bb1770fcfdde2674c6263c8af6d88 Mon Sep 17 00:00:00 2001 From: MTsfoni Date: Mon, 16 Sep 2024 21:42:11 +0200 Subject: [PATCH] fix: suppress warnings Signed-off-by: MTsfoni --- src/cyclonedx/Serialization/CsvSerializer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cyclonedx/Serialization/CsvSerializer.cs b/src/cyclonedx/Serialization/CsvSerializer.cs index 07cec0d..db0bdfd 100644 --- a/src/cyclonedx/Serialization/CsvSerializer.cs +++ b/src/cyclonedx/Serialization/CsvSerializer.cs @@ -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. @@ -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); @@ -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("Type") ?? Component.Classification.Library, @@ -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;