Files
proxmox/scripts/validation/validate-naming-convention-registry-examples.sh
defiQUG dbd517b279 Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains
- Omit embedded publish git dirs and empty placeholders from index

Made-with: Cursor
2026-04-12 06:12:20 -07:00

34 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Validate naming-conventions registry example JSON against token-registry-entry.schema.json.
# Uses check-jsonschema when available (pip install check-jsonschema).
#
# Env:
# SCHEMA_STRICT=1 exit 1 if check-jsonschema is missing (default: skip with 0)
#
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
SCHEMA="$ROOT/docs/04-configuration/naming-conventions/schemas/token-registry-entry.schema.json"
EX_DIR="$ROOT/docs/04-configuration/naming-conventions/examples"
if ! command -v check-jsonschema &>/dev/null; then
if [[ "${SCHEMA_STRICT:-0}" == "1" ]]; then
echo "error: check-jsonschema not found; pip install check-jsonschema" >&2
exit 1
fi
echo "skip: check-jsonschema not installed (pip install check-jsonschema)"
exit 0
fi
if [[ ! -f "$SCHEMA" ]]; then
echo "error: missing schema $SCHEMA" >&2
exit 1
fi
check-jsonschema --schemafile "$SCHEMA" "$EX_DIR/gru-cusdc-chain138.example.json"
check-jsonschema --schemafile "$SCHEMA" "$EX_DIR/gru-cusdc-v2-chain138.example.json"
check-jsonschema --schemafile "$SCHEMA" "$EX_DIR/gru-cusdt-chain138.example.json"
check-jsonschema --schemafile "$SCHEMA" "$EX_DIR/gru-cusdt-v2-chain138.example.json"
check-jsonschema --schemafile "$SCHEMA" "$EX_DIR/utrnf-lending-triad.example.json"
check-jsonschema --schemafile "$SCHEMA" "$EX_DIR/utrnf-collateral-placeholder.example.json"
echo "OK naming-conventions registry examples (token-registry-entry schema)"