diff --git a/schema-v1.json b/schema-v1.json index 073420ee..7422739e 100644 --- a/schema-v1.json +++ b/schema-v1.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "http://json-schema.org/draft-07/schema", "definitions": { "V1Rule": { "properties": { diff --git a/schema-v1.md b/schema-v1.md index 949cf1c0..c6443f75 100644 --- a/schema-v1.md +++ b/schema-v1.md @@ -1,5 +1,3 @@ -> WETZEL_WARNING: Unrecognized JSON Schema. - # Objects * [`Config (v1)`](#reference-config-(v1)) (root object) diff --git a/schema-v2.json b/schema-v2.json index 89372baa..387ad022 100644 --- a/schema-v2.json +++ b/schema-v2.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "http://json-schema.org/draft-07/schema", "definitions": { "ActionConfig": { "description": "Represents a config to perform a certain action for a GMail thread/message/attachment.", diff --git a/schema-v2.md b/schema-v2.md index aa27c059..27b86417 100644 --- a/schema-v2.md +++ b/schema-v2.md @@ -1,5 +1,3 @@ -> WETZEL_WARNING: Unrecognized JSON Schema. - # Objects * [`ActionConfig`](#reference-actionconfig) * [`Config (v2)`](#reference-config-(v2)) (root object) diff --git a/scripts/gen-schema.sh b/scripts/gen-schema.sh index f2dfff42..69af7dae 100755 --- a/scripts/gen-schema.sh +++ b/scripts/gen-schema.sh @@ -7,7 +7,7 @@ schemaName="${2:?}" rootTitle="${3:?}" npx typescript-json-schema tsconfig.json "${typeName}" --required --titles -o "schema-${schemaName}-gen.json" -node_modules/node-jq/bin/jq ". + {\"title\": \"${rootTitle}\"}" <"schema-${schemaName}-gen.json" >"schema-${schemaName}.json" +node_modules/node-jq/bin/jq ".[\"\$schema\"]=\"http://json-schema.org/draft-07/schema\"|.\"title\"=\"${rootTitle}\"" <"schema-${schemaName}-gen.json" >"schema-${schemaName}.json" npx prettier -w "schema-${schemaName}.json" npx wetzel "schema-${schemaName}.json" >"schema-${schemaName}.md" rm -f "schema-${schemaName}-gen.json"