Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecations for component.author and metadata.manufacture #343

Merged
merged 2 commits into from
Sep 8, 2024

Conversation

andreas-hilti
Copy link
Contributor

No description provided.

Signed-off-by: andreas hilti <69210561+andreas-hilti@users.noreply.github.com>
@andreas-hilti andreas-hilti changed the title Add deprecations for component.author and metatada.manufacture Add deprecations for component.author and metadata.manufacture Aug 31, 2024
@andreas-hilti andreas-hilti marked this pull request as draft August 31, 2024 19:12
@andreas-hilti
Copy link
Contributor Author

andreas-hilti commented Aug 31, 2024

The Obsolete attribute causes the xml serialization to ignore the corresponding element; I don't see a neat workaround.
Compare also:
https://stackoverflow.com/questions/331013/obsolete-attribute-causes-property-to-be-ignored-by-xmlserialization

@mtsfoni
Copy link
Contributor

mtsfoni commented Sep 1, 2024

The usual fix to make another property for the xml serialization which is not browsable should still work, shouldn't it?

Signed-off-by: andreas hilti <69210561+andreas-hilti@users.noreply.github.com>
@andreas-hilti
Copy link
Contributor Author

The usual fix to make another property for the xml serialization which is not browsable should still work, shouldn't it?

Yes, it would (I guess acceptable, but not super neat).

@@ -108,10 +108,20 @@ public enum ComponentScope
public List<OrganizationalContact> Authors { get; set; }
public bool ShouldSerializeAuthors() { return Authors?.Count > 0; }

[XmlElement("author")]
[Obsolete("This will be removed in a future version. Use @.authors or @.manufacturer instead.")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should be manufacture like property name.

Copy link
Contributor Author

@andreas-hilti andreas-hilti Sep 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thompson-tomo Sorry, I don't understand your comment. The obsolete comment is a one-to-one copy from the specification:
https://cyclonedx.org/docs/1.6/json/#components_items_author

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting that the obsoletion text it has the property "manufacturer" however when u look at the class it is actually "manufacture"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the metadata, there is both "manfacture" (deprecated) and "manufacturer".
In component, you only have "manufacturer".

@mtsfoni
Copy link
Contributor

mtsfoni commented Sep 7, 2024

Is there still something to do here? The pr is still marked as draft.

@andreas-hilti andreas-hilti marked this pull request as ready for review September 7, 2024 19:37
@andreas-hilti
Copy link
Contributor Author

Is there still something to do here? The pr is still marked as draft.

From my point of view, no. However, this depends also on the comment above.

@mtsfoni mtsfoni merged commit 78a1f74 into CycloneDX:cdx1.6 Sep 8, 2024
7 checks passed
@andreas-hilti andreas-hilti deleted the cdx1.6_deprecations branch September 14, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants