Added schemas for datasets

This commit is contained in:
Michael Chen 2022-11-23 14:10:20 +01:00
parent e623b960a6
commit 15ed7a5c73
Signed by: cnml
GPG Key ID: 5845BF3F82D5F629
2 changed files with 117 additions and 0 deletions

43
dataset.schema.json Normal file
View File

@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"type": "object",
"patternProperties": {
".+": {
"type": "object",
"properties": {
"title": { "type": "string" },
"slug": { "type": "string" },
"stars": { "type": "integer" },
"forks": { "type": "integer" },
"data": { "type": "object" },
"owner": { "type": "object" },
"owner_name": { "type": "string" },
"owner_slug": { "type": "string" },
"s": { "type": "integer" },
"e": { "type": "integer" },
"i": { "type": "integer" },
"a": { "type": "integer" },
"t": { "type": "integer" },
"l": { "type": "integer" },
"tech": { "type": "array", "items": { "type": "string" } }
},
"required": [
"title",
"slug",
"stars",
"forks",
"data",
"owner",
"owner_name",
"owner_slug",
"s",
"e",
"i",
"a",
"t",
"l",
"tech"
]
}
}
}

View File

@ -0,0 +1,74 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"patternProperties": {
"^\\d+$": {
"type": "object",
"additionalProperties": false,
"properties": {
"status": {
"type": "string",
"enum": [
"disregarded",
"observed",
"not applicable",
"unknown"
]
},
"argument": {
"type": "string"
},
"artifacts": {
"type": "array",
"items": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"file": {
"type": "string"
},
"lines": {
"type": "array",
"items": [
{
"type": "integer"
}
]
}
},
"required": [
"file",
"lines"
]
}
]
}
},
"required": [
"status",
"argument"
]
}
},
"required": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18"
]
}