diff --git a/data/schema/v2/Decision_Point_Value_Selection-2-0-0.schema.json b/data/schema/v2/Decision_Point_Value_Selection-2-0-0.schema.json index d26e6822..ac4b04f8 100644 --- a/data/schema/v2/Decision_Point_Value_Selection-2-0-0.schema.json +++ b/data/schema/v2/Decision_Point_Value_Selection-2-0-0.schema.json @@ -37,7 +37,6 @@ } }, "required": [ - "definition", "key" ], "type": "object" @@ -154,7 +153,6 @@ "namespace", "key", "version", - "definition", "values" ], "type": "object" diff --git a/data/schema_examples/CVE-1900-1234-Decision_Point_Value_Selection-2-0-0.json b/data/schema_examples/CVE-1900-1234-Decision_Point_Value_Selection-2-0-0.json new file mode 100644 index 00000000..1474b52b --- /dev/null +++ b/data/schema_examples/CVE-1900-1234-Decision_Point_Value_Selection-2-0-0.json @@ -0,0 +1,34 @@ +{ + "target_ids": ["CVE-1900-1234"], + "timestamp": "2021-09-29T15:29:44Z", + "schemaVersion": "2.0.0", + "selections": [ + { + "namespace": "ssvc", + "name": "Exploitation", + "key": "E", + "version": "1.1.0", + "values": [ + {"name":"Active", "key": "A"} + ] + }, + { + "namespace": "ssvc", + "name": "Automatable", + "key": "A", + "version": "2.0.0", + "values": [ + {"name": "Yes", "key": "Y"} + ] + }, + { + "namespace": "ssvc", + "name": "Technical Impact", + "key": "TI", + "version": "1.0.0", + "values": [ + {"name": "Total","key":"T"} + ] + } + ] +} diff --git a/src/ssvc/doctools.py b/src/ssvc/doctools.py index 873a3df1..3f6f3542 100755 --- a/src/ssvc/doctools.py +++ b/src/ssvc/doctools.py @@ -27,11 +27,11 @@ To generate the documentation for the decision points, use the following command: - python -m ssvc.doctools --overwrite --jsondir ./tmp/json_out` + python -m ssvc.doctools --overwrite --datadir ./tmp/json_out` To regenerate the existing docs, use the following command: - python -m ssvc.doctools --overwrite --jsondir data/json + python -m ssvc.doctools --overwrite --datadir data """ import importlib diff --git a/src/ssvc/selection.py b/src/ssvc/selection.py index 440834eb..9b8ee2c3 100644 --- a/src/ssvc/selection.py +++ b/src/ssvc/selection.py @@ -154,7 +154,7 @@ def validate_values(cls, data): def model_json_schema(cls, **kwargs): schema = super().model_json_schema(**kwargs) - not_required = ["name", "description"] + not_required = ["name","definition"] if "required" in schema and isinstance(schema["required"], list): # remove description from required list if it exists schema["required"] = [ @@ -330,7 +330,7 @@ def model_json_schema(cls, **kwargs): non_required_fields = [ "name", - "description", + "definition", "target_ids", "decision_point_resources", "references",