Skip to content

Commit 35e769e

Browse files
committed
Add System.Text.Json.Serialization.JsonConverterAttribute to enums
1 parent a009fc8 commit 35e769e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Microsoft.ComponentDetection.Contracts/ProcessingResultCode.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
namespace Microsoft.ComponentDetection.Contracts;
22

3+
using System.Text.Json.Serialization;
4+
35
/// <summary>Code used to communicate the state of a scan after completion.</summary>
6+
[JsonConverter(typeof(JsonStringEnumConverter))]
47
public enum ProcessingResultCode
58
{
69
/// <summary>The scan was completely successful.</summary>

src/Microsoft.ComponentDetection.Contracts/TypedComponent/ComponentType.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
namespace Microsoft.ComponentDetection.Contracts.TypedComponent;
22

33
using System.Runtime.Serialization;
4+
using System.Text.Json.Serialization;
45

56
// This is used in BcdeModels as well
67
[DataContract]
8+
[JsonConverter(typeof(JsonStringEnumConverter))]
79
public enum ComponentType : byte
810
{
911
[EnumMember]

0 commit comments

Comments
 (0)