--- /dev/null
+name: Validate JSON
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ validate:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Validate JSON
+ uses: walbo/validate-json@v1.1.0
+ with:
+ files: programs/*.json
+ schema: json-schema/program.json
+ schema-version: draft-07
+ fail-on-missing-schema: true
+ strict: true
+++ /dev/null
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "title": "File schema",
- "properties": {
- "path": {
- "type": "string",
- "description": "Path to file (or folder).",
- "minLength": 1
- },
- "movable": {
- "type": "boolean",
- "description": "Is file (or folder) movable to a place other than $HOME."
- },
- "help": {
- "type": "string",
- "description": "Help text for user. Supports markdown."
- }
- },
- "required": [
- "path",
- "movable",
- "help"
- ]
-}
\ No newline at end of file
{
- "$schema": "http://json-schema.org/draft-07/schema#",
"title": "Program",
"description": "Specification of files or folders in the $HOME folder for a program",
+ "type": "object",
"properties": {
"name": {
"type": "string",
"description": "List of files (or folders) associated with the program",
"type": "array",
"items": {
- "$ref": "file.json"
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string",
+ "description": "Path to file (or folder).",
+ "minLength": 1
+ },
+ "movable": {
+ "type": "boolean",
+ "description": "Is file (or folder) movable to a place other than $HOME."
+ },
+ "help": {
+ "type": "string",
+ "description": "Help text for user. Supports markdown."
+ }
+ },
+ "required": [
+ "path",
+ "movable",
+ "help"
+ ]
},
"minItems": 1
}
"name",
"files"
]
-}
\ No newline at end of file
+}