From e2de5486596d867dd75fb514a12c7a5bd2cb28a4 Mon Sep 17 00:00:00 2001 From: Fernando-A-Rocha Date: Sat, 18 Jan 2025 15:28:08 +0000 Subject: [PATCH] Update validator --- schemas/article.yaml | 2 +- schemas/{structure.yaml => navigation.yaml} | 2 +- tools/validate.cmd | 7 +++++++ tools/validate.sh | 2 +- wiki/{structure.yaml => navigation.yaml} | 0 5 files changed, 10 insertions(+), 3 deletions(-) rename schemas/{structure.yaml => navigation.yaml} (96%) rename wiki/{structure.yaml => navigation.yaml} (100%) diff --git a/schemas/article.yaml b/schemas/article.yaml index 264ae62..68edfa8 100644 --- a/schemas/article.yaml +++ b/schemas/article.yaml @@ -1,5 +1,5 @@ $schema: "https://json-schema.org/draft/2020-12/schema" -$id: "/schemas/structure" +$id: "/schemas/navigation" title: "Wiki Article Schema" type: "object" required: diff --git a/schemas/structure.yaml b/schemas/navigation.yaml similarity index 96% rename from schemas/structure.yaml rename to schemas/navigation.yaml index 0ec284c..c0fdeca 100644 --- a/schemas/structure.yaml +++ b/schemas/navigation.yaml @@ -1,5 +1,5 @@ $schema: "https://json-schema.org/draft/2020-12/schema" -$id: "/schemas/structure" +$id: "/schemas/navigation" title: "Wiki Navigation Schema" type: "object" diff --git a/tools/validate.cmd b/tools/validate.cmd index 3eea1b3..0993e20 100644 --- a/tools/validate.cmd +++ b/tools/validate.cmd @@ -1,5 +1,12 @@ @echo off +.\tools\yajsv.exe -s schemas/navigation.yaml "wiki/navigation.yaml" +.\tools\yajsv.exe -s schemas/categories.yaml "wiki/categories.yaml" + for /r "functions" %%f in (*.yaml) do ( .\tools\yajsv.exe -s schemas/function.yaml "%%f" ) + +for /r "articles" %%f in (*.yaml) do ( + .\tools\yajsv.exe -s schemas/article.yaml "%%f" +) diff --git a/tools/validate.sh b/tools/validate.sh index b2497c3..a6cb593 100644 --- a/tools/validate.sh +++ b/tools/validate.sh @@ -1,6 +1,6 @@ #!/bin/bash -tools/yajsv -s schemas/structure.yaml wiki/structure.yaml +tools/yajsv -s schemas/navigation.yaml wiki/navigation.yaml tools/yajsv -s schemas/categories.yaml wiki/categories.yaml find 'functions/' -name '*.yaml' -type f -print0 | xargs -0 -I {} tools/yajsv -s schemas/function.yaml {} diff --git a/wiki/structure.yaml b/wiki/navigation.yaml similarity index 100% rename from wiki/structure.yaml rename to wiki/navigation.yaml