Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck committed May 6, 2024
1 parent 218d357 commit 647753b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
5 changes: 1 addition & 4 deletions cyclonedx/schema/_res/bom-1.2-strict.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"enum": [
"http://cyclonedx.org/schema/bom-1.2b.schema.json"
]
"type": "string"
},
"bomFormat": {
"$id": "#/properties/bomFormat",
Expand Down
5 changes: 1 addition & 4 deletions cyclonedx/schema/_res/bom-1.3-strict.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"enum": [
"http://cyclonedx.org/schema/bom-1.3a.schema.json"
]
"type": "string"
},
"bomFormat": {
"$id": "#/properties/bomFormat",
Expand Down
5 changes: 1 addition & 4 deletions cyclonedx/schema/_res/bom-1.4.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"enum": [
"http://cyclonedx.org/schema/bom-1.4.schema.json"
]
"type": "string"
},
"bomFormat": {
"type": "string",
Expand Down
5 changes: 1 addition & 4 deletions cyclonedx/schema/_res/bom-1.5.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"enum": [
"http://cyclonedx.org/schema/bom-1.5.schema.json"
]
"type": "string"
},
"bomFormat": {
"type": "string",
Expand Down
11 changes: 6 additions & 5 deletions tools/schema-downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
]
}

# "version" is not required but optional with a default value!
# this is wrong in schema<1.5
# "$schema" is not required but optional.
# that enum constraint value there is complicated -> remove it.
# See https://github.com/CycloneDX/specification/issues/402
# See https://github.com/CycloneDX/specification/pull/403
_BOM_SCHEMA_ENUM_RE = re.compile(
r'("\$id": "(http://cyclonedx\.org/schema/bom.+?\.schema\.json)".*"enum": \[\s+")'
r'http://cyclonedx\.org/schema/bom.+?\.schema\.json"',
r',?\s*"enum":\s*\[\s*"http://cyclonedx\.org/schema/.+?\.schema\.json"\s*\]',
re.DOTALL)
_BOM_SCHEMA_ENUM_REPL = r'\1\2"'
_BOM_SCHEMA_ENUM_REPL = r''


# "version" is not required but optional with a default value!
Expand Down

0 comments on commit 647753b

Please sign in to comment.