Skip to content

Commit

Permalink
Add database_specific to affected[].ranges[]. (#37)
Browse files Browse the repository at this point in the history
* Add database_specific to `affected[].ranges[]`.

This is intended only for metadata that enables databases to losslessly
convert OSV entries back into their original representation.

Part of #35.

* Update docs/schema.md

Co-authored-by: Chris Bloom <[email protected]>

Co-authored-by: Chris Bloom <[email protected]>
  • Loading branch information
oliverchang and chrisbloom7 authored Mar 24, 2022
1 parent ef3f219 commit 6b7d0a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ A JSON Schema for validation is also available
"fixed": string,
"last_affected": string,
"limit": string
} ]
} ],
"database_specific": { see description }
} ],
"versions": [ string ],
"ecosystem_specific": { see description },
Expand Down Expand Up @@ -490,6 +491,17 @@ describing a single range. The range object defines the fields `type`,

This field is required if `affected[].ranges[].type` is `GIT`.

### affected[].ranges[].database_specific field

The `ranges` object's `database_specific` field is a JSON object holding
additional information about the range from which the record was obtained. The
meaning of the values within the object is entirely defined by the database and
beyond the scope of this document.

Databases should only use this field to store additional context that may be useful in converting from the OSV
format back into the original database representation. Values in this field
have no effect on the [evaluation algorithm](#evaluation).

### affected[].ecosystem_specific field

The `affected` object's `ecosystem_specific` field is a JSON object holding
Expand Down
3 changes: 3 additions & 0 deletions validation/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
]
},
"minItems": 1
},
"database_specific": {
"type": "object"
}
},
"allOf": [
Expand Down

0 comments on commit 6b7d0a4

Please sign in to comment.