-
-
Notifications
You must be signed in to change notification settings - Fork 67
CycloneDX v1.3 JSON Schema - canonical (duplicate) $id
errors
#123
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
Comments
Thanks for the detailed report, @mrutkows . Do you see similarities to #83? How do you see the removal of the all the How would you describe an ideal solution? |
If #83 and #84 were combined (with subsequent discussions included) and netted out eventually identify all 3 $id duplication are identified (but still do not call out all 6 specific
This issue summarizes the problem along with a comprehensive list of all occurrences of duplicate $id usage (along with line numbers and snippets). There are 2 distinct cases that I call out here:
Again, with the proper use of As to fixing in v1.4 (e.g., as |
Ideally, my approach would be to remove the problematic $ids in favor of $ref; specifically:
Risks... My primary concern is leaving in top-level If you want further risk reduction... Preserve all $ids, but fix all paths as shown in my previous comment (this is what I did locally in a local schema copy my Go code uses as a minimal fix). This does still beg the use case as to when |
@jkowalleck Does #84 address all the necessary changes required to fix the 1.2 and 1.3 JSON schemas? If not, would it be possible to do so? |
@mrutkows
|
@stevespringett basically, yes. BUT |
my rule of thumb for fixing: if a Therefore i would prefer #84 over #125. Maybe i am not seeing something. @mrutkows Do you see a benefit in #125 over #84? regarding #125 I have some questions, @mrutkows :
|
@jkowalleck Please see PR opened to show what could be a minimally invasive "fix" that reduces risk if adopted in the existing 1.3 release line. Again, I am in full support that with a new miner release, all $id usage beyond the base URI should be removed as I see is the case for current v1.4 schema. |
@stevespringett as far as i understand it, we have two options ready to fix/address this issues: Guess it is time for the working groups to make a decision if and how to address the topic... |
@jkowalleck Please know I did not produce PR 125 to "compete" in an either/or manner with PR 84, but was only providing what I was asked for in terms of "minimally invasive" (least risk). Hope you have an informed discussion. |
updated the proposed CI/CT in #110 |
Thanks for all the work on this. PR #125 has been merged that fixes schema versions 1.2 and 1.3 in a minimally invasive way. All official CycloneDX tools will be updated with newer versions of the schemas. |
General Problem
Within the latest, published v1.3 JSON schema (i.e., https://github.com/CycloneDX/specification/blob/master/schema/bom-1.3.schema.json)
The same local
$id
value being used within 2 different definitions (i.e., both at top-level and under the"definitions"
key) which cause "canonical id" or similar errors using several JSON schema validators referenced by the JSON schema project (ignored to unknown results by some others). Output of errors shown below for two tools.Notes:
$id
occurrences listed below.JSON Schema reference (applicable to problem space)
Declared schema:
Draft 7: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-01
Draft 7 release notes which may contain applicable comments under release notes:
See: https://json-schema.org/draft/2019-09/release-notes.html
Incompatible Changes:
Semi-incompatible Changes
Reproducible in tools
Investigation
Performing a manual inspection of schema...
Base URI
Specific instances of problem
specification/schema/bom-1.3.schema.json
Line 161 in c710388
specification/schema/bom-1.3.schema.json
Line 812 in c710388
specification/schema/bom-1.3.schema.json
Line 52 in c710388
specification/schema/bom-1.3.schema.json
Line 398 in c710388
specification/schema/bom-1.3.schema.json
Line 59 in c710388
specification/schema/bom-1.3.schema.json
Line 921 in c710388
Notes/Observation
Unsure of use case for declaring an $id in these fragments (i.e., why do these $id" declarations exist at all)
Cut/paste error (copied JSON fragment from top-level to "tools"?
for example, these are the only "definitions" that have an "$id" (again $ref" usage in call cases is fine):
The text was updated successfully, but these errors were encountered: