Skip to content

Commit febcef6

Browse files
Distinguish resource from references in Selections #833
1 parent 42cab20 commit febcef6

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

data/schema/v2/Decision_Point_Value_Selection-2-0-0.schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@
202202
"minItems": 1,
203203
"type": "array"
204204
},
205-
"resources": {
206-
"title": "Resources",
207-
"description": "A list of references to resources that provide additional context about the decision points found in this selection.",
205+
"decision_point_resources": {
206+
"title": "Decision Point Resources",
207+
"description": "A list of resources that provide additional context about the decision points found in this selection.",
208208
"examples": [
209209
[
210210
{
@@ -229,7 +229,7 @@
229229
},
230230
"references": {
231231
"title": "References",
232-
"description": "A list of references to resources that provide additional context about the specific values selected.",
232+
"description": "A list of references that provide additional context about the specific values selected.",
233233
"examples": [
234234
[
235235
{

src/ssvc/selection.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ class SelectionList(_Timestamped, BaseModel):
201201
Optional fields include
202202
203203
- `target_ids`: If present, a non-empty list of identifiers for the item or items being evaluated.
204-
- `resources`: If present, a non-empty list of references to resources that provide additional context about the decision points
204+
- `decision_point_resources`: If present, a non-empty list of resources that provide information related to the decision points
205205
found in this selection. Resources point to documentation, JSON files, or other relevant information that
206206
describe what the decision points are and how they should be interpreted.
207-
- `references`: If present, a non-empty list of references to resources that provide additional context about the specific values selected.
207+
- `references`: If present, a non-empty list of resources that provide additional context about the specific values selected.
208208
References point to reports, advisories, or other relevant information that describe why the selected values were chosen.
209209
"""
210210

@@ -237,10 +237,10 @@ class SelectionList(_Timestamped, BaseModel):
237237
description="Timestamp of the selections, in RFC 3339 format.",
238238
examples=["2025-01-01T12:00:00Z", "2025-01-02T15:30:45-04:00"],
239239
)
240-
resources: list[Reference] = Field(
240+
decision_point_resources: list[Reference] = Field(
241241
default_factory=list,
242242
min_length=1,
243-
description="A list of references to resources that provide additional context about the decision points found in this selection.",
243+
description="A list of resources that provide additional context about the decision points found in this selection.",
244244
examples=[
245245
[
246246
{
@@ -261,7 +261,7 @@ class SelectionList(_Timestamped, BaseModel):
261261
references: list[Reference] = Field(
262262
default_factory=list,
263263
min_length=1,
264-
description="A list of references to resources that provide additional context about the specific values selected.",
264+
description="A list of references that provide additional context about the specific values selected.",
265265
examples=[
266266
[
267267
{
@@ -329,7 +329,7 @@ def model_json_schema(cls, **kwargs):
329329
"name",
330330
"description",
331331
"target_ids",
332-
"resources",
332+
"decision_point_resources",
333333
"references",
334334
]
335335

@@ -377,7 +377,7 @@ def main() -> None:
377377
references=[
378378
Reference(
379379
uri="https://example.com/report",
380-
description="A report on which the selections were based",
380+
summary="A report on which the selections were based",
381381
)
382382
],
383383
)

src/test/test_selections.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ def test_selection_list_optional_fields(self):
306306
selections=[self.s1, self.s2],
307307
timestamp=datetime.now(),
308308
target_ids=["CVE-1900-0001"],
309-
resources=[ref],
309+
decision_point_resources=[ref],
310310
references=[ref],
311311
)
312312

313-
self.assertEqual(len(sel_list.resources), 1)
313+
self.assertEqual(len(sel_list.decision_point_resources), 1)
314314
self.assertEqual(len(sel_list.references), 1)
315-
self.assertEqual(sel_list.resources[0].uri, ref.uri)
315+
self.assertEqual(sel_list.decision_point_resources[0].uri, ref.uri)
316316

317317
def test_model_json_schema_customization(self):
318318
"""Test that JSON schema is properly customized."""
@@ -334,7 +334,7 @@ def test_model_json_schema_customization(self):
334334
"name",
335335
"description",
336336
"target_ids",
337-
"resources",
337+
"decision_point_resources",
338338
"references",
339339
]
340340
for field in optional_fields:

0 commit comments

Comments
 (0)