File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const inputSchema = /** @type {const} */ ({
2222 optionalProperties : {
2323 content : {
2424 additionalProperties : true ,
25- properties : {
25+ optionalProperties : {
2626 ssvc_v1 : {
2727 additionalProperties : true ,
2828 properties : { } ,
@@ -66,14 +66,16 @@ export function mandatoryTest_6_1_46(doc) {
6666
6767 doc . vulnerabilities ?. forEach ( ( vulnerability , vulnerabilityIndex ) => {
6868 vulnerability . metrics ?. forEach ( ( metric , metricIndex ) => {
69- const valid = validate_ssvc_v1 ( metric . content ?. ssvc_v1 )
70- if ( ! valid ) {
71- ctx . isValid = false
72- for ( const err of validate_ssvc_v1 . errors ?? [ ] ) {
73- ctx . errors . push ( {
74- instancePath : `/vulnerabilities/${ vulnerabilityIndex } /metrics/${ metricIndex } /content/ssvc_v1${ err . instancePath } ` ,
75- message : err . message ?? '' ,
76- } )
69+ if ( metric . content ?. ssvc_v1 ) {
70+ const valid = validate_ssvc_v1 ( metric . content . ssvc_v1 )
71+ if ( ! valid ) {
72+ ctx . isValid = false
73+ for ( const err of validate_ssvc_v1 . errors ?? [ ] ) {
74+ ctx . errors . push ( {
75+ instancePath : `/vulnerabilities/${ vulnerabilityIndex } /metrics/${ metricIndex } /content/ssvc_v1${ err . instancePath } ` ,
76+ message : err . message ?? '' ,
77+ } )
78+ }
7779 }
7880 }
7981 } )
You can’t perform that action at this time.
0 commit comments