The script that generates the configuration JSON schema with the correct values.
run = { cmd = "scripts/poe-tasks/run", help = "Run Knot Resolver" }
run-debug = { cmd = "scripts/poe-tasks/run-debug", help = "Debug Knot Resolver with debugpy" }
doc = { cmd = "scripts/poe-tasks/doc", help = "Create Knot Resolver HTML documentation" }
+doc-schema = { cmd = "scripts/poe-tasks/doc-schema", help = "Generate a JSON schema of the Knot Resolver configuration"}
test = { cmd = "scripts/poe-tasks/test", help = "Run pytest unit tests" }
check = { cmd = "scripts/poe-tasks/check", help = "Check that all dependencies are installed and run static code analysis" }
examples = { cmd = "scripts/poe-tasks/examples", help = "Validate all configuration examples using 'kresctl validate' utility" }
# dirs paths
RUN_DIR = Path("/run/knot-resolver")
ETC_DIR = Path("/etc/knot-resolver")
-SBIN_DIR = Path("/usr/bin")
+SBIN_DIR = Path("/usr/sbin")
CACHE_DIR = Path("/var/cache/knot-resolver")
# files paths
echo ------------------------------------------
echo Removing Meson build directories and files
echo ------------------------------------------
-rm -vrf "$build_dir" "$KRES_INSTALL_DIR" "$build_doc_dir" build dist
+rm -vrf "$build_dir" "$KRES_INSTALL_DIR" "$build_schema_dir" "$build_doc_dir" build dist
echo
echo ------------------------------------------
--- /dev/null
+#!/usr/bin/env bash
+
+# ensure consistent behaviour
+src_dir="$(dirname "$(realpath "$0")")"
+source $src_dir/utils/_env.sh
+
+rm -rf $build_schema_dir > /dev/null
+meson setup \
+ $build_schema_dir \
+ --buildtype=release \
+ --prefix=/usr > /dev/null
+cp -v $build_schema_dir/python/constants.py $gitroot/python/knot_resolver/constants.py
+
+python -m knot_resolver.client schema > $gitroot/doc/_static/config.schema.json
+rm -rf $build_schema_dir
# build dirs
build_dir="$gitroot/.build"
build_doc_dir="$gitroot/.build_doc"
+build_schema_dir="$gitroot/.build_schema"
install_dir="$gitroot/.install"
# ensure consistent environment with virtualenv