Skip to content

ENG-49: Restore privacy-center Swagger UI#8190

Merged
gilluminate merged 3 commits into
mainfrom
gill/ENG-49/restore-swagger
May 14, 2026
Merged

ENG-49: Restore privacy-center Swagger UI#8190
gilluminate merged 3 commits into
mainfrom
gill/ENG-49/restore-swagger

Conversation

@gilluminate
Copy link
Copy Markdown
Contributor

@gilluminate gilluminate commented May 14, 2026

Ticket ENG-49

Description Of Changes

The privacy-center Swagger UI page at clients/privacy-center/app/docs/page.tsx was disabled during the React 19 upgrade because swagger-ui-react lacked React 19 peer-dep support. swagger-ui-react@5.32.6 now declares react: ">=16.8.0 <20", so React 19 is compatible. This PR re-enables the page.

While we were in there, the admin-ui had a duplicate "Fides JS docs" page (/fides-js-docs) whose next-swagger-doc config pointed at ../privacy-center/pages/api anyway, so it was rendering exactly the same schema. Removed it along with its route, nav entry, and its swagger-ui-react / @types/swagger-ui-react / next-swagger-doc dependencies.

Code Changes

  • Added swagger-ui-react@^5.32.6 and @types/swagger-ui-react@^5.18.0 to clients/privacy-center/package.json.
  • Re-enabled the SwaggerUI import + CSS import + <SwaggerUI url="/api/openapi.json" /> render in clients/privacy-center/app/docs/page.tsx; removed the <h1>Not available</h1> placeholder.
  • Documented the dev-only /docs and /api/openapi.json URLs in clients/privacy-center/README.md.
  • Deleted the duplicate clients/admin-ui/src/pages/fides-js-docs.tsx and clients/admin-ui/src/pages/api/openapi.json.ts.
  • Removed the FIDES_JS_DOCS route export and the "Fides JS docs" nav entry from admin-ui.
  • Removed swagger-ui-react, @types/swagger-ui-react, and next-swagger-doc from clients/admin-ui/package.json.
  • Refreshed clients/package-lock.json.

Steps to Confirm

  1. From clients/privacy-center, run npm run dev (port 3001).
  2. Visit http://localhost:3001/docs — the Swagger UI should render with "Fides Privacy Center API" and the endpoints defined in pages/api/* JSDoc blocks. No console errors.
  3. Visit http://localhost:3001/api/openapi.json — JSON schema returned.
  4. Build for production (NODE_ENV=production npm run build && npm start) and visit /docs — should 404.
  5. From clients/admin-ui, run npm run dev (port 3000). Open the developer nav — there should be no "Fides JS docs" entry. Visiting /fides-js-docs directly should 404.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

gilluminate and others added 2 commits May 14, 2026 14:45
swagger-ui-react now supports React 19 (>=5.30), so re-enable the
dev-only /docs page. Remove the duplicate admin-ui Swagger setup
that pointed at privacy-center's pages/api folder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview May 14, 2026 8:47pm
fides-privacy-center Ignored Ignored May 14, 2026 8:47pm

Request Review

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
See the Details below.

Scanned Files

  • clients/admin-ui/package.json
  • clients/package-lock.json
  • clients/privacy-center/package.json

@gilluminate gilluminate marked this pull request as ready for review May 14, 2026 20:48
@gilluminate gilluminate requested a review from a team as a code owner May 14, 2026 20:48
@gilluminate gilluminate requested review from lucanovera and removed request for a team May 14, 2026 20:48
@github-actions
Copy link
Copy Markdown

Title Lines Statements Branches Functions
admin-ui Coverage: 9%
6.89% (3150/45697) 6.26% (1655/26425) 4.78% (647/13520)
fides-js Coverage: 78%
79.17% (1977/2497) 66.25% (1249/1885) 73.31% (349/476)
privacy-center Coverage: 85%
82.53% (364/441) 79.74% (189/237) 74.07% (60/81)

Copy link
Copy Markdown
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up this tech debt!
Confirmed swagger is working in dev mode. Not in production builds and completely removed from admin-ui. Approved!
Image

@gilluminate gilluminate added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 9302ee0 May 14, 2026
52 checks passed
@gilluminate gilluminate deleted the gill/ENG-49/restore-swagger branch May 14, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants