Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions data/schema/v2/Decision_Point_Value_Selection-2-0-0.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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": [
[
{
Expand All @@ -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": [
[
{
Expand Down
18 changes: 9 additions & 9 deletions src/ssvc/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down Expand Up @@ -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=[
[
{
Expand All @@ -252,16 +252,16 @@ 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",
},
],
],
)
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=[
[
{
Expand Down Expand Up @@ -329,7 +329,7 @@ def model_json_schema(cls, **kwargs):
"name",
"description",
"target_ids",
"resources",
"decision_point_resources",
"references",
]

Expand Down Expand Up @@ -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",
)
],
)
Expand Down
8 changes: 4 additions & 4 deletions src/test/test_selections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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:
Expand Down