From 18995715250c4fc08eb5ff97415485a2e8994bfb Mon Sep 17 00:00:00 2001 From: Matthias Lechner Date: Fri, 24 Jul 2026 07:33:50 +0000 Subject: [PATCH 1/2] feat: add MIAF section Signed-off-by: Matthias Lechner --- scripts/sync-general-content.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/sync-general-content.sh b/scripts/sync-general-content.sh index 622c3a2..5cb4897 100755 --- a/scripts/sync-general-content.sh +++ b/scripts/sync-general-content.sh @@ -104,6 +104,7 @@ cat > "$ROOT_DIR/content/docs/specification/meta.json" < Date: Fri, 24 Jul 2026 08:58:41 +0000 Subject: [PATCH 2/2] fix: generate Swagger UI for every OpenAPI document, not just the management API Signed-off-by: Matthias Lechner --- scripts/sync-general-content.sh | 39 +++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/scripts/sync-general-content.sh b/scripts/sync-general-content.sh index 5cb4897..c0bf16f 100755 --- a/scripts/sync-general-content.sh +++ b/scripts/sync-general-content.sh @@ -136,30 +136,47 @@ find "$ROOT_DIR/content/docs" -type f -name "*.md" -print0 | while IFS= read -r done echo "Generating SwaggerUI MDX files..." -rm -f "$ROOT_DIR/content/docs/specification/margo-management-interface/management-interface-swagger.md" -find "$ROOT_DIR/content/docs" -type f \( -name "workload-management-api-1.0.0.yaml" -o -name "workload-management-api-1.0.0.yml" \) -print0 | while IFS= read -r -d '' yaml; do +find "$ROOT_DIR/content/docs" -type f -name "*-swagger.md" -delete +find "$ROOT_DIR/content/docs" -type f \( -name "*.yaml" -o -name "*.yml" \) -print0 | while IFS= read -r -d '' yaml; do + grep -qiE '^openapi:' "$yaml" || continue mdx="${yaml%.*}.mdx" base="$(basename "$yaml")" + # Page title from the document's info.title (falls back to the file name). + # Strip a surrounding pair of quotes from the scalar; the frontmatter re-quotes it. + title="$(awk ' + /^info:/ { in_info = 1; next } + in_info && /^[^[:space:]]/ { in_info = 0 } + in_info && /^[[:space:]]+title:[[:space:]]*/ { + sub(/^[[:space:]]+title:[[:space:]]*/, "") + sub(/\r$/, ""); sub(/[[:space:]]+$/, "") + if ($0 ~ /^".*"$/ || $0 ~ /^\047.*\047$/) $0 = substr($0, 2, length($0) - 2) + print; exit + }' "$yaml")" + title="${title:-${base%.*}} - Swagger UI" + title="${title//\"/\\\"}" # escape double quotes for the YAML frontmatter string cat > "$mdx" < EOF done echo "Rewriting legacy Swagger UI links..." -legacy_swagger_target="../margo-management-interface/management-interface-swagger.md" -current_swagger_target="../margo-management-interface/workload-management-api-1.0.0" -find "$ROOT_DIR/content/docs" -type f \( -name "*.md" -o -name "*.mdx" \) -print0 | while IFS= read -r -d '' doc; do - if grep -q "$legacy_swagger_target" "$doc"; then +while read -r legacy current; do + [ -n "$legacy" ] || continue + find "$ROOT_DIR/content/docs" -type f \( -name "*.md" -o -name "*.mdx" \) -print0 | while IFS= read -r -d '' doc; do + grep -q "$legacy" "$doc" || continue if [[ "$OSTYPE" == "darwin"* ]]; then - sed -i '' "s|$legacy_swagger_target|$current_swagger_target|g" "$doc" + sed -i '' "s|${legacy}\.md|${current}|g; s|${legacy}|${current}|g" "$doc" else - sed -i "s|$legacy_swagger_target|$current_swagger_target|g" "$doc" + sed -i "s|${legacy}\.md|${current}|g; s|${legacy}|${current}|g" "$doc" fi - fi -done + done +done <<'PAIRS' +management-interface-swagger workload-management-api-1.0.0 +trust-bundle-api-swagger trust-bundle-api-1.0.0 +PAIRS echo "Copying OpenAPI specs to public..." find "$ROOT_DIR/content/docs" -type f \( -name "*.yaml" -o -name "*.yml" \) -print0 | while IFS= read -r -d '' yaml; do