-
-
Notifications
You must be signed in to change notification settings - Fork 54
feat: avoid raising NoPropertiesProvidedException
for optional parameters
#786
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
Conversation
b97fd1b
to
0e31022
Compare
regarding your findings, Thank you in advance for all your effort 👍 |
NoPropertiesProvidedException
I found in class docstring where it seems to mention the spec URL, i followed that and my assessments seems to suggest following
is this ok? |
re: #786 (comment)
Yes, can do. there are no mandatory attributes/properties.
You are right, this should require both. Nice find! What needs to be changed here is to make both attributes/properties non-optional and to have no default value, and remove the now unnecessary |
Hi Apologies for delay, i got unplanned travel plans over weekend so couldn't continue on this, will continue on this from this week.. I have created a separate issue for mandatory field #790 What are your thoughts about |
did a global search and found these file/classes raising this exception | File | Class | Doc | Comment | | ---------------------- | ---------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | | model/**init**.py | IdentifiableAction | [Link](https://cyclonedx.org/docs/1.6/xml/#type_identifiableActionType-doc-panel-collapse) | Yes, Can Remove | | model/component.py | Commit | [Link](https://cyclonedx.org/docs/1.6/xml/#type_commitType-instance-table-collapse) | Yes, Can Remove | | model/component.py | ComponentEvidence | [Link](https://cyclonedx.org/docs/1.6/xml/#type_componentEvidenceType-instance-table-collapse) | 1 issue, attributes not updated since 1.5 code has TODO, but everythin is optional so can do? | | model/component.py | Diff | [link](https://cyclonedx.org/docs/1.6/xml/#type_diffType-instance-table-collapse) | Yes, Can Remove | | model/component.py | Pedigree | [link](https://cyclonedx.org/docs/1.6/xml/#type_pedigreeType-instance-table-collapse) | Yes, Can Remove | | model/issue.py | IssueTypeSource | [link](https://cyclonedx.org/docs/1.6/xml/#type_issueType-instance-table-collapse) | Yes, Can remove | | model/vulnerability.py | BomTargetVersionRange | [link](https://cyclonedx.org/docs/1.6/xml/#type_vulnerabilityType) | This prolly can not be empty if initialized | | model/vulnerability.py | VulnerabilityAnalysis | [link](https://cyclonedx.org/docs/1.6/xml/#type_vulnerabilityType) | Yes, Can Remove. But two keys missing `firstIssued` and `lastUpdated` | | model/vulnerability.py | VulnerabilitySource | [link](https://cyclonedx.org/docs/1.6/xml/#type_vulnerabilitySourceType) | Yes, Can remove | | model/vulnerability.py | VulnerabilityReference | [link](https://cyclonedx.org/docs/1.6/xml/#type_vulnerabilityType) | Both are necessary its not either attribute, currently check asks for either which might be wrong? | | model/vulnerability.py | VulnerabilityRating | [link](https://cyclonedx.org/docs/1.6/xml/#type_ratingType-instance-table-collapse) | Yes, Can remove | | model/vulnerability.py | VulnerabilityCredits | [link](https://cyclonedx.org/docs/1.6/xml/#type_vulnerabilityType) | Yes, Can Remove | Signed-off-by: Indivar Mishra <indimishra@gmail.com>
found few classes having incorrect url in vulnerability module while going through them Signed-off-by: Indivar Mishra <indimishra@gmail.com>
0e31022
to
7eeb036
Compare
hey @jkowalleck I updated all of them as per above mentioned table with exception of following two
on side note should test snapshot
output of
|
NoPropertiesProvidedException
NoPropertiesProvidedException
for optional parameters
created a ticket for this: |
regarding |
the following classes' init no longer raise
NoPropertiesProvidedException
:cyclonedx.model.IdentifiableAction
cyclonedx.model.component.Commit
cyclonedx.model.component.ComponentEvidence
cyclonedx.model.component.Diff
cyclonedx.model.component.Pedigree
cyclonedx.model.issue.IssueTypeSource
cyclonedx.model.vulnerability.VulnerabilityAnalysis
cyclonedx.model.vulnerability.VulnerabilityCredits
cyclonedx.model.vulnerability.VulnerabilityRating
cyclonedx.model.vulnerability.VulnerabilitySource
did a global search and found these file/classes
raising this exception
File - Class
model/init.py - IdentifiableAction
model/component.py - Commit
model/component.py - ComponentEvidence
model/component.py - Diff
model/component.py - Pedigree
model/issue.py - IssueTypeSource
model/model.py - BomTargetVersionRange
model/model.py - VulnerabilityAnalysis
model/model.py - VulnerabilitySource
model/model.py - VulnerabilityReference
model/model.py - VulnerabilityRating
model/model.py - VulnerabilityCredits
fixes #776