Skip to content

Commit

Permalink
feat: machine readable record feedback JSON schema (#2541)
Browse files Browse the repository at this point in the history
First iteration of the JSON schema for encapsulating machine-readable
feedback on individual OSV records.

Part of #2189
  • Loading branch information
andrewpollock authored Sep 3, 2024
1 parent 741a8b6 commit 7ec31bd
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions osv/feedback.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/google/osv.dev/main/osv/invalid_records_schema.json",
"type": "object",
"default": {},
"title": "The OSV.dev invalid record Schema",
"required": [
"invalid_records"
],
"properties": {
"invalid_records": {
"type": "array",
"default": [],
"title": "The OSV.dev per-source invalid records",
"items": {
"type": "object",
"title": "An individual invalid record",
"required": [
"id",
"finding_first_seen",
"import_last_attempt",
"findings"
],
"properties": {
"id": {
"type": "string",
"title": "The id of the OSV record",
"examples": [
"GSD-2021-1001229",
"GSD-2022-1003535"
]
},
"import_last_attempt": {
"type": "string",
"title": "When an import for this record was last attempted in RFC3339",
"examples": [
"2024-05-03T08:15:00Z"
]
},
"findings": {
"type": "array",
"title": "Reasons for invalidity",
"items": {
"type": "string"
},
"examples": [
[ "INVALID_JSON" ],
[ "DELETED" ]
]
}
},
"examples": [{
"id": "GSD-2021-1001229",
"finding_first_seen": "2024-04-01T08:15:00Z",
"import_last_attempt": "2024-05-03T08:15:00Z",
"findings": [
"INVALID_JSON"
]
},
{
"id": "GSD-2022-1003535",
"finding_first_seen": "2024-04-01T08:15:00Z",
"import_last_attempt": "2024-05-03T08:15:00Z",
"findings": [
"DELETED"
]
}]
},
"examples": [
[{
"id": "GSD-2021-1001229",
"finding_first_seen": "2024-04-01T08:15:00Z",
"import_last_attempt": "2024-05-03T08:15:00Z",
"findings": [
"INVALID_JSON"
]
},
{
"id": "GSD-2022-1003535",
"finding_first_seen": "2024-04-01T08:15:00Z",
"import_last_attempt": "2024-05-03T08:15:00Z",
"findings": [
"DELETED"
]
}]
]
}
},
"examples": [{
"invalid_records": [{
"id": "GSD-2021-1001229",
"finding_first_seen": "2024-04-01T08:15:00Z",
"import_last_attempt": "2024-05-03T08:15:00Z",
"findings": [
"INVALID_JSON"
]
},
{
"id": "GSD-2022-1003535",
"finding_first_seen": "2024-04-01T08:15:00Z",
"import_last_attempt": "2024-05-03T08:15:00Z",
"findings": [
"DELETED"
]
}]
}]
}

0 comments on commit 7ec31bd

Please sign in to comment.