Skip to content

Commit

Permalink
Fix several enum serializations
Browse files Browse the repository at this point in the history
Signed-off-by: andreas hilti <69210561+andreas-hilti@users.noreply.github.com>
  • Loading branch information
andreas-hilti committed Sep 1, 2024
1 parent e6ebe0c commit 505e0f3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/CycloneDX.Core/Json/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static JsonSerializerOptions GetJsonSerializerOptions()
options.Converters.Add(new EnumMemberConverter<ImplementationPlatform>());
options.Converters.Add(new EvidenceIdentityListConverter());

options.Converters.Add(new HyphenEnumConverter<EvidenceIdentity.EvidenceFieldType>());
options.Converters.Add(new EnumMemberConverter<EvidenceIdentity.EvidenceFieldType>());
options.Converters.Add(new HyphenEnumConverter<EvidenceMethods.EvidenceTechnique>());
options.Converters.Add(new ScoreMethodConverter());
options.Converters.Add(new HyphenEnumConverter<Severity>());
Expand Down
4 changes: 2 additions & 2 deletions src/CycloneDX.Core/Models/AlgorithmProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public enum ExecutionEnvironment
[XmlEnum("software-plain-ram")]
Software_Plain_Ram,
[XmlEnum("software-encrypted-ram")]
Software_Encypted_Ram,
Software_Encrypted_Ram,
[XmlEnum("software-tee")]
Software_TEE,
[XmlEnum("hardware")]
Expand All @@ -403,7 +403,7 @@ public enum Primitive
[XmlEnum("other")]
Other,
[XmlEnum("drbg")]
DRGB,
DRBG,
[XmlEnum("mac")]
MAC,
[XmlEnum("block-cipher")]
Expand Down
2 changes: 1 addition & 1 deletion src/CycloneDX.Core/Models/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Data
public enum DataType
{
[XmlEnum(Name = "source-code")]
SourceCode,
Source_Code,
[XmlEnum(Name = "configuration")]
Configuration,
[XmlEnum(Name = "dataset")]
Expand Down
2 changes: 2 additions & 0 deletions src/CycloneDX.Core/Models/EvidenceIdentity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;
using System.Xml;
using System.Xml.Serialization;
Expand Down Expand Up @@ -50,6 +51,7 @@ public enum EvidenceFieldType
[XmlEnum(Name = "hash")]
Hash,
[XmlEnum(Name = "omniborId")]
[EnumMember(Value = "omniborId")]
OmniborId,
[XmlEnum(Name = "swhid")]
Swhid,
Expand Down
8 changes: 4 additions & 4 deletions src/CycloneDX.Core/Models/ModelCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public enum ModelParameterApproachType
Supervised,
[XmlEnum(Name = "unsupervised")]
Unsupervised,
[XmlEnum(Name = "reinforced-learning")]
ReinforcedLearning,
[XmlEnum(Name = "reinforcement-learning")]
Reinforcement_Learning,
[XmlEnum(Name = "semi-supervised")]
SemiSupervised,
Semi_Supervised,
[XmlEnum(Name = "self-supervised")]
SelfSupervised,
Self_Supervised,
}

[ProtoContract]
Expand Down

0 comments on commit 505e0f3

Please sign in to comment.