Skip to content

Commit

Permalink
fix: trailing hash in schema reference
Browse files Browse the repository at this point in the history
  • Loading branch information
ahochsteger committed Apr 6, 2023
1 parent fbaccdf commit a2749f8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion schema-v1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "http://json-schema.org/draft-07/schema",
"definitions": {
"V1Rule": {
"properties": {
Expand Down
2 changes: 0 additions & 2 deletions schema-v1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
> WETZEL_WARNING: Unrecognized JSON Schema.
# Objects
* [`Config (v1)`](#reference-config-(v1)) (root object)

Expand Down
2 changes: 1 addition & 1 deletion schema-v2.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
2 changes: 0 additions & 2 deletions schema-v2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
> WETZEL_WARNING: Unrecognized JSON Schema.
# Objects
* [`ActionConfig`](#reference-actionconfig)
* [`Config (v2)`](#reference-config-(v2)) (root object)
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a2749f8

Please sign in to comment.