doc: auto-generate the API schema in the documentation

This commit is contained in:
Quentin Gliech
2024-07-24 15:44:08 +02:00
parent c8b4a17a55
commit cc8a16f2d9
3 changed files with 124 additions and 0 deletions

View File

@@ -5,12 +5,14 @@ set -eu
export SQLX_OFFLINE=1
BASE_DIR="$(dirname "$0")/.."
CONFIG_SCHEMA="${BASE_DIR}/docs/config.schema.json"
API_SCHEMA="${BASE_DIR}/docs/api.schema.json"
GRAPHQL_SCHEMA="${BASE_DIR}/frontend/schema.graphql"
POLICIES_SCHEMA="${BASE_DIR}/policies/schema/"
set -x
cargo run -p mas-config > "${CONFIG_SCHEMA}"
cargo run -p mas-handlers --bin graphql-schema > "${GRAPHQL_SCHEMA}"
cargo run -p mas-handlers --bin api-schema > "${API_SCHEMA}"
cargo run -p mas-i18n-scan -- --update "${BASE_DIR}/templates/" "${BASE_DIR}/translations/en.json"
OUT_DIR="${POLICIES_SCHEMA}" cargo run -p mas-policy --features jsonschema