Skip to content

Commit 3330f2b

Browse files
committed
separated vulnerability_replacements in replace_file and replace_data
1 parent 525ce2f commit 3330f2b

File tree

2 files changed

+65
-59
lines changed

2 files changed

+65
-59
lines changed

ods_tools/data/analysis_settings_schema.json

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -412,17 +412,26 @@
412412
}
413413
}
414414
},
415-
"vulnerability_replacements": {
416-
"type": ["object", "string"],
417-
"title": "Vulnerability Replacements",
418-
"description": "This can either be a JSON object with detailed settings (vulnerability ID and associated replacement data) or a path to a csv file with that data.",
419-
"oneOf": [
420-
{
421-
"type": "string",
422-
"description": "Path to a CSV file containing vulnerability data to be replaced."
415+
"vulnerability_adjustments": {
416+
"type": "object",
417+
"title": "Vulnerability Adjustments",
418+
"description": "Object containing vulnerability adjustments and replacements.",
419+
"properties": {
420+
"adjustments": {
421+
"type": "object",
422+
"title": "Vulnerability Factor Adjustments",
423+
"description": "Dictionary containing vulnerability adjustments with vulnerability ID as integer keys and adjustment factors as float values.",
424+
"patternProperties": {
425+
"^[0-9]+$": {
426+
"type": "number",
427+
"minimum": 0
428+
}
429+
},
430+
"additionalProperties": false
423431
},
424-
{
432+
"replace_data": {
425433
"type": "object",
434+
"title": "Vulnerability Replacements",
426435
"description": "Detailed vulnerability replacements.",
427436
"patternProperties": {
428437
"^[0-9]+$": {
@@ -440,21 +449,15 @@
440449
}
441450
},
442451
"additionalProperties": false
443-
}
444-
]
445-
},
446-
"vulnerability_adjustments": {
447-
"type": "object",
448-
"title": "Vulnerability Factor Adjustments",
449-
"description": "Dictionary containing vulnerability adjustments with vulnerability ID as integer keys and adjustment factors as float values.",
450-
"patternProperties": {
451-
"^[0-9]+$": {
452-
"type": "number",
453-
"minimum": 0
452+
},
453+
"replace_file": {
454+
"type": "string",
455+
"title": "Vulnerability Replacement File",
456+
"description": "Path to a CSV file containing vulnerability data to be replaced."
454457
}
455458
},
456459
"additionalProperties": false
457-
},
460+
},
458461
"gul_output": {
459462
"type": "boolean",
460463
"title": "Produce GUL output",

ods_tools/data/model_settings_schema.json

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -531,47 +531,50 @@
531531
},
532532
"vulnerability_adjustments": {
533533
"type": "object",
534-
"title": "Vulnerability Factor Adjustments",
535-
"description": "Dictionary containing vulnerability adjustments with vulnerability ID as integer keys and adjustment factors as float values.",
536-
"patternProperties": {
537-
"^[0-9]+$": {
538-
"type": "number",
539-
"minimum": 0
534+
"title": "Vulnerability Adjustments",
535+
"description": "Object containing vulnerability adjustments and replacements.",
536+
"properties": {
537+
"adjustments": {
538+
"type": "object",
539+
"title": "Vulnerability Factor Adjustments",
540+
"description": "Dictionary containing vulnerability adjustments with vulnerability ID as integer keys and adjustment factors as float values.",
541+
"patternProperties": {
542+
"^[0-9]+$": {
543+
"type": "number",
544+
"minimum": 0
545+
}
546+
},
547+
"additionalProperties": false
548+
},
549+
"replace_data": {
550+
"type": "object",
551+
"title": "Vulnerability Replacements",
552+
"description": "Detailed vulnerability replacements.",
553+
"patternProperties": {
554+
"^[0-9]+$": {
555+
"type": "array",
556+
"items": {
557+
"type": "array",
558+
"minItems": 3,
559+
"maxItems": 3,
560+
"items": [
561+
{ "type": "integer" },
562+
{ "type": "integer" },
563+
{ "type": "number", "minimum": 0, "maximum": 1 }
564+
]
565+
}
566+
}
567+
},
568+
"additionalProperties": false
569+
},
570+
"replace_file": {
571+
"type": "string",
572+
"title": "Vulnerability Replacement File",
573+
"description": "Path to a CSV file containing vulnerability data to be replaced."
540574
}
541575
},
542576
"additionalProperties": false
543-
},
544-
"vulnerability_replacements": {
545-
"type": ["object", "string"],
546-
"title": "Vulnerability Replacements",
547-
"description": "This can either be a JSON object with detailed settings (vulnerability ID and associated replacement data) or a path to a csv file with that data.",
548-
"oneOf": [
549-
{
550-
"type": "string",
551-
"description": "Path to a CSV file containing vulnerability data to be replaced."
552-
},
553-
{
554-
"type": "object",
555-
"description": "Detailed vulnerability replacements.",
556-
"patternProperties": {
557-
"^[0-9]+$": {
558-
"type": "array",
559-
"items": {
560-
"type": "array",
561-
"minItems": 3,
562-
"maxItems": 3,
563-
"items": [
564-
{ "type": "integer" },
565-
{ "type": "integer" },
566-
{ "type": "number", "minimum": 0, "maximum": 1 }
567-
]
568-
}
569-
}
570-
},
571-
"additionalProperties": false
572-
}
573-
]
574-
},
577+
},
575578
"string_parameters":{
576579
"title":"Single string paramters",
577580
"type":"array",

0 commit comments

Comments
 (0)