Skip to content

Commit

Permalink
Fix xml serialization of component (order of elements)
Browse files Browse the repository at this point in the history
Signed-off-by: andreas hilti <[email protected]>
  • Loading branch information
andreas-hilti committed Nov 24, 2024
1 parent cacc25f commit bf12324
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/CycloneDX.Core/Models/Component.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ public LicenseChoiceList LicensesSerialized
[ProtoMember(16)]
public string Purl { get; set; }

[XmlElement("omniborId")]
[ProtoMember(31)]
public List<string> OmniborId { get; set; }
public bool ShouldSerializeOmniborId() { return OmniborId?.Count > 0; }

[XmlElement("swhid")]
[ProtoMember(32)]
public List<string> Swhid { get; set; }
public bool ShouldSerializeSwhid() { return Swhid?.Count > 0; }

[XmlElement("swid")]
[ProtoMember(17)]
public Swid Swid { get; set; }
Expand Down Expand Up @@ -268,16 +278,6 @@ public bool NonNullableModified
public List<string> Tags { get; set; }
public bool ShouldSerializeTags() { return Tags?.Count > 0; }

[XmlElement("omniborId")]
[ProtoMember(31)]
public List<string> OmniborId { get; set; }
public bool ShouldSerializeOmniborId() { return OmniborId?.Count > 0; }

[XmlElement("swhid")]
[ProtoMember(32)]
public List<string> Swhid { get; set; }
public bool ShouldSerializeSwhid() { return Swhid?.Count > 0; }

[XmlAnyElement("Signature", Namespace = "http://www.w3.org/2000/09/xmldsig#")]
[JsonIgnore]
public XmlElement XmlSignature { get; set; }
Expand Down

0 comments on commit bf12324

Please sign in to comment.