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 e91cbc38..685bbd8e 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 @@ -74,8 +74,8 @@ "examples": [ "ssvc", "cisa", - "x_com.example//com.example#private", - "ssvc/de-DE/example.organization#reference-arch-1" + "x_example.test#test//.example.test#private-extension", + "ssvc/de-DE/.example.organization#reference-arch-1" ], "maxLength": 1000, "minLength": 3, @@ -202,9 +202,9 @@ "minItems": 1, "type": "array" }, - "resources": { - "title": "Resources", - "description": "A list of references to resources that provide additional context about the decision points found in this selection.", + "decision_point_resources": { + "title": "Decision Point Resources", + "description": "A list of resources that provide additional context about the decision points found in this selection.", "examples": [ [ { @@ -229,7 +229,7 @@ }, "references": { "title": "References", - "description": "A list of references to resources that provide additional context about the specific values selected.", + "description": "A list of references that provide additional context about the specific values selected.", "examples": [ [ { diff --git a/src/ssvc/selection.py b/src/ssvc/selection.py index 7aeaac09..b7a36798 100644 --- a/src/ssvc/selection.py +++ b/src/ssvc/selection.py @@ -201,10 +201,10 @@ class SelectionList(_Timestamped, BaseModel): Optional fields include - `target_ids`: If present, a non-empty list of identifiers for the item or items being evaluated. - - `resources`: If present, a non-empty list of references to resources that provide additional context about the decision points + - `decision_point_resources`: If present, a non-empty list of resources that provide information related to the decision points found in this selection. Resources point to documentation, JSON files, or other relevant information that describe what the decision points are and how they should be interpreted. - - `references`: If present, a non-empty list of references to resources that provide additional context about the specific values selected. + - `references`: If present, a non-empty list of resources that provide additional context about the specific values selected. References point to reports, advisories, or other relevant information that describe why the selected values were chosen. """ @@ -237,10 +237,10 @@ class SelectionList(_Timestamped, BaseModel): description="Timestamp of the selections, in RFC 3339 format.", examples=["2025-01-01T12:00:00Z", "2025-01-02T15:30:45-04:00"], ) - resources: list[Reference] = Field( + decision_point_resources: list[Reference] = Field( default_factory=list, min_length=1, - description="A list of references to resources that provide additional context about the decision points found in this selection.", + description="A list of resources that provide additional context about the decision points found in this selection.", examples=[ [ { @@ -252,8 +252,8 @@ class SelectionList(_Timestamped, BaseModel): "summary": "JSON representation of decision point 2", }, { - "uri": "https://test.example/ssvc/x_example.test#test/decision_points.json", - "summary": "A JSON file containing extension decision points in the x_example.test#test namespace", + "uri": "https://example.com/ssvc/x_com.example/decision_points.json", + "summary": "A JSON file containing extension decision points in the x_com.example namespace", }, ], ], @@ -261,7 +261,7 @@ class SelectionList(_Timestamped, BaseModel): references: list[Reference] = Field( default_factory=list, min_length=1, - description="A list of references to resources that provide additional context about the specific values selected.", + description="A list of references that provide additional context about the specific values selected.", examples=[ [ { @@ -329,7 +329,7 @@ def model_json_schema(cls, **kwargs): "name", "description", "target_ids", - "resources", + "decision_point_resources", "references", ] @@ -377,7 +377,7 @@ def main() -> None: references=[ Reference( uri="https://example.com/report", - description="A report on which the selections were based", + summary="A report on which the selections were based", ) ], ) diff --git a/src/test/test_selections.py b/src/test/test_selections.py index 6c9c3c34..429413cc 100644 --- a/src/test/test_selections.py +++ b/src/test/test_selections.py @@ -306,13 +306,13 @@ def test_selection_list_optional_fields(self): selections=[self.s1, self.s2], timestamp=datetime.now(), target_ids=["CVE-1900-0001"], - resources=[ref], + decision_point_resources=[ref], references=[ref], ) - self.assertEqual(len(sel_list.resources), 1) + self.assertEqual(len(sel_list.decision_point_resources), 1) self.assertEqual(len(sel_list.references), 1) - self.assertEqual(sel_list.resources[0].uri, ref.uri) + self.assertEqual(sel_list.decision_point_resources[0].uri, ref.uri) def test_model_json_schema_customization(self): """Test that JSON schema is properly customized.""" @@ -334,7 +334,7 @@ def test_model_json_schema_customization(self): "name", "description", "target_ids", - "resources", + "decision_point_resources", "references", ] for field in optional_fields: