mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-29 18:27:19 +00:00
Add validator for galaxies
This commit is contained in:
parent
910398fe76
commit
9bf4da3a7a
4 changed files with 46 additions and 2 deletions
|
@ -10,4 +10,10 @@ do
|
||||||
cat ${dir} | jq . | sponge ${dir}
|
cat ${dir} | jq . | sponge ${dir}
|
||||||
done
|
done
|
||||||
|
|
||||||
cat schema.json | jq . | sponge schema.json
|
for dir in galaxies/*.json
|
||||||
|
do
|
||||||
|
cat ${dir} | jq . | sponge ${dir}
|
||||||
|
done
|
||||||
|
|
||||||
|
cat schema_clusters.json | jq . | sponge schema_clusters.json
|
||||||
|
cat schema_galaxies.json | jq . | sponge schema_galaxies.json
|
||||||
|
|
31
schema_galaxies.json
Normal file
31
schema_galaxies.json
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"$schema": "http://json-schema.org/schema#",
|
||||||
|
"title": "Validator for misp-galaxies",
|
||||||
|
"id": "https://www.github.com/MISP/misp-galaxies/schema.json",
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"type",
|
||||||
|
"version",
|
||||||
|
"name",
|
||||||
|
"uuid"
|
||||||
|
]
|
||||||
|
}
|
|
@ -15,7 +15,14 @@ fi
|
||||||
for dir in clusters/*.json
|
for dir in clusters/*.json
|
||||||
do
|
do
|
||||||
echo -n "${dir}: "
|
echo -n "${dir}: "
|
||||||
jsonschema -i ${dir} schema.json
|
jsonschema -i ${dir} schema_clusters.json
|
||||||
|
echo ''
|
||||||
|
done
|
||||||
|
|
||||||
|
for dir in galaxies/*.json
|
||||||
|
do
|
||||||
|
echo -n "${dir}: "
|
||||||
|
jsonschema -i ${dir} schema_galaxies.json
|
||||||
echo ''
|
echo ''
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue