Skip to content

API Docs Build Fix #3766

Merged
MuhammadKhalilzadeh merged 9 commits intodevelopfrom
mo-338-april-21-enhancments
Apr 21, 2026
Merged

API Docs Build Fix #3766
MuhammadKhalilzadeh merged 9 commits intodevelopfrom
mo-338-april-21-enhancments

Conversation

@MuhammadKhalilzadeh
Copy link
Copy Markdown
Collaborator

API Docs Build Fix

Please ensure all items are checked off before requesting a review:

  • I deployed the code locally.
  • I have performed a self-review of my code.
  • I have included the issue # in the PR.
  • I have labelled the PR correctly.
  • The issue I am working on is assigned to me.
  • I have avoided using hardcoded values to ensure scalability and maintain consistency across the application.
  • I have ensured that font sizes, color choices, and other UI elements are referenced from the theme.
  • My pull request is focused and addresses a single, specific feature.

Problem

After generating endpoints.ts from swagger.yaml and updating App.tsx, the docs/api-docs app failed to build due to:

  1. Missing endpoint groupsslackWebhookEndpoints, tokenEndpoints, and userPreferenceEndpoints were imported in App.tsx but didn't exist in endpoints.ts because the swagger spec tagged those endpoints under parent categories (Integrations, Authentication, Users).
  2. Missing nav items/sections — Several generated endpoint groups (demoData, internal, riskHistory, setting, webhooks) had no corresponding sidebar entries or EndpointSection renders.
  3. Generated TypeScript errors — The endpoint generator produced in: 'undefined' and in: 'cookie' parameter values that violated the Parameter type.
  4. UserGuide icon type errors — Three UserGuide components used collection.icon (a string) directly as a JSX component, causing TS errors.
  5. Missing index.html — The Vite entry point was absent, preventing both npm run dev and npm run build.
  6. Deprecated baseUrl in tsconfig — TypeScript native preview (TS 7) flagged baseUrl as removed and required relative path prefixes.

Changes Made

Commit 1 — fix(swagger): re-tag slack-webhooks, tokens, user-preferences as separate groups

File: Servers/swagger.yaml

Re-tagged 14 operations so the generator creates dedicated endpoint groups:

Endpoints Old Tag New Tag
/slackWebhooks/* (6 ops) Integrations Slack Webhooks
/tokens/* (3 ops) Authentication Tokens
/user-preferences/* (3 ops) Users User Preferences
/users/login, /users/refresh-token (2 ops) Users - Authentication Authentication

Commit 2 — feat(api-docs): regenerate endpoints.ts with corrected tags

Files: Servers/scripts/generateEndpointsTs.ts, docs/api-docs/src/config/endpoints.ts

  • Added Authentication to the explicit tag-to-variable-name map in the generator.
  • Added parameter filtering to skip entries with undefined name/in or non-standard in values (e.g., cookie).
  • Regenerated endpoints.ts — now produces 62 endpoint groups (up from 61), including the new slackWebhookEndpoints, tokenEndpoints, userPreferenceEndpoints, and authenticationEndpoints.

Commit 3 — fix(api-docs): add missing nav items/sections and fix UserGuide icon types

Files: docs/api-docs/src/App.tsx, docs/api-docs/src/components/UserGuide/iconResolver.ts (new), ArticlePage.tsx, CollectionPage.tsx, UserGuideLanding.tsx

  • Added imports for demoDataEndpoints, internalEndpoints, riskHistoryEndpoints, settingEndpoints.
  • Added 5 sidebar nav items: Risk history, Settings, Webhooks, Demo data, Internal.
  • Added 5 EndpointSection renders for the above groups.
  • Created iconResolver.ts — maps IconName strings to lucide-react components.
  • Fixed three UserGuide components to use resolveIcon(collection.icon) instead of using the string directly as JSX.

Commit 4 — fix(api-docs): add missing index.html for standalone dev and build

File: docs/api-docs/index.html (new)

Added the standard Vite entry point HTML file that mounts the React app at #root.

Commit 5 — fix(api-docs): remove baseUrl and use relative paths in tsconfig

File: docs/api-docs/tsconfig.json

  • Removed deprecated baseUrl option (removed in TypeScript 7).
  • Changed path values to use relative ./ prefixes ("./src/*", "./node_modules/lucide-react").
  • Changed include entry from "src" to "./src".

Verification

Check Result
npx tsc --noEmit Pass (0 errors)
npm run build (tsc + vite) Pass
npm run dev Serves at localhost:5173, HTTP 200

Notes

  • The docs/api-docs app is a standalone Vite/React application. It is not integrated into the main Clients app.
  • The vite build emits a chunk size warning (2.1 MB bundle) — this is advisory only and could be addressed with code-splitting in the future.
  • Total endpoint count: 553 endpoints across 62 groups.

MuhammadKhalilzadeh and others added 9 commits April 21, 2026 21:39
Creates a Node.js script that reads Servers/swagger.yaml and generates
the docs/api-docs/src/config/endpoints.ts file automatically. This
eliminates the need to manually maintain two sources of API documentation.

Usage: cd Servers && npx ts-node scripts/generateEndpointsTs.ts

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Auto-generated using the new generateEndpointsTs.ts script.
Expands from 187 manually-maintained endpoints to 553 endpoints
across 59 groups, now fully in sync with swagger.yaml.

New endpoint groups added: Agent discovery, AI advisor, AI detection,
Approval workflows, Audit ledger, Change history, Compliance score,
Datasets, Entity graph, FRIA, Intake forms, Invitations, LLM keys,
Notes, Notifications, Plugins, Post-market monitoring, Quantitative
risks, Risk benchmarks, Shadow AI, Super admin, and more.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Updates imports, navigation items, and section renderers to display
all 59 endpoint groups from the regenerated endpoints.ts. Adds new
sidebar categories and sections for AI governance, compliance, risk
management, and advanced features. Updates version badge to v2.0.0.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…rate groups

Move /slackWebhooks/* from Integrations to Slack Webhooks, /tokens/*
from Authentication to Tokens, /user-preferences/* from Users to
User Preferences, and /users/login + /users/refresh-token from
Users - Authentication to Authentication so the api-docs generator
creates dedicated endpoint groups for each.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add Authentication to explicit tag map, filter out parameters with
undefined name/in or cookie parameters to prevent TS errors, then
regenerate endpoints.ts producing 62 endpoint groups including the
new slackWebhook, token, userPreference, and authentication groups.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…types

Add sidebar nav items and EndpointSection renders for riskHistory,
setting, demoData, internal, and webhooks groups. Import the four
newly generated endpoint arrays. Also fix pre-existing TS errors in
UserGuide components by adding an iconResolver that maps IconName
strings to actual lucide-react components.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The Vite entry point was missing, preventing both `npm run dev` and
`npm run build` from completing. Add a minimal index.html that mounts
the React app at #root.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
TypeScript 7 (native preview) removed the baseUrl option. Drop it
and prefix all path values with ./ so the config is compatible with
both TS 5.x and the TS native-preview language server.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@MuhammadKhalilzadeh MuhammadKhalilzadeh self-assigned this Apr 21, 2026
@MuhammadKhalilzadeh MuhammadKhalilzadeh added documentation Improvements or additions to documentation enhancement New feature or request descriptive/informative labels Apr 21, 2026
@MuhammadKhalilzadeh MuhammadKhalilzadeh changed the title ## API Docs Build Fix API Docs Build Fix Apr 21, 2026
@MuhammadKhalilzadeh MuhammadKhalilzadeh added this to the 2.3 milestone Apr 21, 2026
@MuhammadKhalilzadeh MuhammadKhalilzadeh merged commit 14a8336 into develop Apr 21, 2026
3 of 4 checks passed
@MuhammadKhalilzadeh MuhammadKhalilzadeh deleted the mo-338-april-21-enhancments branch April 21, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

descriptive/informative documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant