You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: centralize version and version-range (#322)
goal: improve documentation by consolidating elements regarding
"version".
pure refactoring, no new functionality was added, nor removed, nor
changed.
- [x] consolidate `version`
- [x] consolidate `range`
- [x] rename `range` definition to `version-range`
- [x] add more examples
- [x] review rendered documentation
Copy file name to clipboardExpand all lines: schema/bom-1.6.schema.json
+30-12Lines changed: 30 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -299,7 +299,7 @@
299
299
"description": "The name of the tool"
300
300
},
301
301
"version": {
302
-
"type": "string",
302
+
"$ref": "#/definitions/version",
303
303
"title": "Tool Version",
304
304
"description": "The version of the tool"
305
305
},
@@ -457,10 +457,9 @@
457
457
"examples": ["tomcat-catalina"]
458
458
},
459
459
"version": {
460
-
"type": "string",
460
+
"$ref": "#/definitions/version",
461
461
"title": "Component Version",
462
-
"description": "The component version. The version should ideally comply with semantic versioning but is not enforced.",
463
-
"examples": ["9.0.14"]
462
+
"description": "The component version. The version should ideally comply with semantic versioning but is not enforced."
464
463
},
465
464
"description": {
466
465
"type": "string",
@@ -1277,10 +1276,9 @@
1277
1276
"examples": ["ticker-service"]
1278
1277
},
1279
1278
"version": {
1280
-
"type": "string",
1279
+
"$ref": "#/definitions/version",
1281
1280
"title": "Service Version",
1282
-
"description": "The service version.",
1283
-
"examples": ["1.0.0"]
1281
+
"description": "The service version."
1284
1282
},
1285
1283
"description": {
1286
1284
"type": "string",
@@ -2285,7 +2283,7 @@
2285
2283
},
2286
2284
"range": {
2287
2285
"description": "A version range specified in Package URL Version Range syntax (vers) which is defined at https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst",
2288
-
"$ref": "#/definitions/range"
2286
+
"$ref": "#/definitions/versionRange"
2289
2287
},
2290
2288
"status": {
2291
2289
"description": "The vulnerability status for the version or range of versions.",
@@ -2320,16 +2318,36 @@
2320
2318
]
2321
2319
},
2322
2320
"version": {
2323
-
"description": "A single version of a component or service.",
2321
+
"description": "A single disjunctive version identifier, for a component or service.",
2324
2322
"type": "string",
2325
2323
"minLength": 1,
2326
-
"maxLength": 1024
2324
+
"maxLength": 1024,
2325
+
"examples": [
2326
+
"9.0.14",
2327
+
"v1.33.7",
2328
+
"7.0.0-M1",
2329
+
"2.0pre1",
2330
+
"1.0.0-beta1",
2331
+
"0.8.15"
2332
+
]
2327
2333
},
2328
-
"range": {
2334
+
"versionRange": {
2329
2335
"description": "A version range specified in Package URL Version Range syntax (vers) which is defined at https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst",
Copy file name to clipboardExpand all lines: schema/bom-1.6.xsd
+42-5Lines changed: 42 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,43 @@ limitations under the License.
54
54
<xs:restrictionbase="bom:refType"/>
55
55
</xs:simpleType>
56
56
57
+
<xs:simpleTypename="versionType">
58
+
<xs:annotation>
59
+
<xs:documentationxml:lang="en"><![CDATA[
60
+
A single disjunctive version identifier, for a component or service.
61
+
62
+
Example values:
63
+
- "9.0.14"
64
+
- "v1.33.7"
65
+
- "7.0.0-M1"
66
+
- "2.0pre1"
67
+
- "1.0.0-beta1"
68
+
- "0.8.15"
69
+
]]>
70
+
</xs:documentation>
71
+
</xs:annotation>
72
+
<xs:restrictionbase="xs:normalizedString"/>
73
+
</xs:simpleType>
74
+
<xs:simpleTypename="versionRangeType">
75
+
<xs:annotation>
76
+
<xs:documentationxml:lang="en"><![CDATA[
77
+
A version range specified in Package URL Version Range syntax (vers) which is defined at https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst
<xs:documentation>A version range specified in Package URL Version Range syntax (vers) which is defined at https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst</xs:documentation>
0 commit comments