Skip to content

Commit 42c6f25

Browse files
committed
docs
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent b4a133a commit 42c6f25

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

cyclonedx/schema/_res/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ some schema for offline use as download via [script](../../../tools/schema-downl
44
original sources: <https://github.com/CycloneDX/specification/tree/master/schema>
55

66
Currently using version
7-
[299209abd9531d808e0cc4235e77a7c4b1b53d96](https://github.com/CycloneDX/specification/commit/299209abd9531d808e0cc4235e77a7c4b1b53d96)
7+
[55343ba19dee1785acf1ce9191540d5fd7b590db](https://github.com/CycloneDX/specification/commit/55343ba19dee1785acf1ce9191540d5fd7b590db)
88

99
| file | note |
1010
|------|------|
@@ -14,10 +14,12 @@ Currently using version
1414
| [`bom-1.3.SNAPSHOT.xsd`](bom-1.3.SNAPSHOT.xsd) | applied changes: 1 |
1515
| [`bom-1.4.SNAPSHOT.xsd`](bom-1.4.SNAPSHOT.xsd) | applied changes: 1 |
1616
| [`bom-1.5.SNAPSHOT.xsd`](bom-1.5.SNAPSHOT.xsd) | applied changes: 1 |
17+
| [`bom-1.6.SNAPSHOT.xsd`](bom-1.6.SNAPSHOT.xsd) | applied changes: 1 |
1718
| [`bom-1.2.SNAPSHOT.schema.json`](bom-1.2.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
1819
| [`bom-1.3.SNAPSHOT.schema.json`](bom-1.3.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
1920
| [`bom-1.4.SNAPSHOT.schema.json`](bom-1.4.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
2021
| [`bom-1.5.SNAPSHOT.schema.json`](bom-1.5.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
22+
| [`bom-1.6.SNAPSHOT.schema.json`](bom-1.6.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
2123
| [`bom-1.2-strict.SNAPSHOT.schema.json`](bom-1.2-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
2224
| [`bom-1.3-strict.SNAPSHOT.schema.json`](bom-1.3-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
2325
| [`spdx.SNAPSHOT.xsd`](spdx.SNAPSHOT.xsd) | |

examples/complex_deserialize.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
# region JSON
3434

3535
json_data = """{
36-
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
36+
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
3737
"bomFormat": "CycloneDX",
38-
"specVersion": "1.5",
38+
"specVersion": "1.6",
3939
"serialNumber": "urn:uuid:88fabcfa-7529-4ba2-8256-29bec0c03900",
4040
"version": 1,
4141
"metadata": {
@@ -145,7 +145,7 @@
145145
}
146146
]
147147
}"""
148-
my_json_validator = JsonStrictValidator(SchemaVersion.V1_5)
148+
my_json_validator = JsonStrictValidator(SchemaVersion.V1_6)
149149
try:
150150
validation_errors = my_json_validator.validate_str(json_data)
151151
if validation_errors:
@@ -165,7 +165,7 @@
165165
# endregion XML
166166

167167
xml_data = """<?xml version="1.0" ?>
168-
<bom xmlns="http://cyclonedx.org/schema/bom/1.5"
168+
<bom xmlns="http://cyclonedx.org/schema/bom/1.6"
169169
serialNumber="urn:uuid:88fabcfa-7529-4ba2-8256-29bec0c03900"
170170
version="1"
171171
>
@@ -246,7 +246,7 @@
246246
</dependency>
247247
</dependencies>
248248
</bom>"""
249-
my_xml_validator: 'XmlValidator' = make_schemabased_validator(OutputFormat.XML, SchemaVersion.V1_5)
249+
my_xml_validator: 'XmlValidator' = make_schemabased_validator(OutputFormat.XML, SchemaVersion.V1_6)
250250
try:
251251
validation_errors = my_xml_validator.validate_str(xml_data)
252252
if validation_errors:

examples/complex_serialize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
my_json_outputter: 'JsonOutputter' = JsonV1Dot5(bom)
8383
serialized_json = my_json_outputter.output_as_string(indent=2)
8484
print(serialized_json)
85-
my_json_validator = JsonStrictValidator(SchemaVersion.V1_5)
85+
my_json_validator = JsonStrictValidator(SchemaVersion.V1_6)
8686
try:
8787
validation_errors = my_json_validator.validate_str(serialized_json)
8888
if validation_errors:
@@ -99,7 +99,7 @@
9999
# region XML
100100
"""demo with implicit instructions for SchemaVersion, outputter and validator. TypeCheckers will catch errors."""
101101

102-
my_xml_outputter: 'XmlOutputter' = make_outputter(bom, OutputFormat.XML, SchemaVersion.V1_5)
102+
my_xml_outputter: 'XmlOutputter' = make_outputter(bom, OutputFormat.XML, SchemaVersion.V1_6)
103103
serialized_xml = my_xml_outputter.output_as_string(indent=2)
104104
print(serialized_xml)
105105
my_xml_validator: 'XmlValidator' = make_schemabased_validator(

tests/test_schema_SchemaVersion.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@
2121

2222
from cyclonedx.schema import SchemaVersion
2323

24-
SORTED_SV = (SchemaVersion.V1_6,
25-
SchemaVersion.V1_5,
26-
SchemaVersion.V1_4,
27-
SchemaVersion.V1_3,
28-
SchemaVersion.V1_2,
29-
SchemaVersion.V1_1,
30-
SchemaVersion.V1_0)
24+
SORTED_SV = (
25+
SchemaVersion.V1_6,
26+
SchemaVersion.V1_5,
27+
SchemaVersion.V1_4,
28+
SchemaVersion.V1_3,
29+
SchemaVersion.V1_2,
30+
SchemaVersion.V1_1,
31+
SchemaVersion.V1_0
32+
)
3133

3234
# do not use any value-comparisons or implicit hash-functions here !
3335
# just work with the position in tuple SORTED_SCHEMA_VERSIONS

0 commit comments

Comments
 (0)