feat: add OpenAPI 3.1 spec and interactive Swagger UI docs page (#241)#278
feat: add OpenAPI 3.1 spec and interactive Swagger UI docs page (#241)#278devendra-w wants to merge 13 commits into
Conversation
|
@devendra-w is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @devendra-w — this PR has a merge conflict (likely git fetch upstream
git rebase upstream/main
# for package-lock.json conflicts: delete the file and run npm install to regenerate
git push --force-with-leaseOnce rebased, we'll do a full review. |
f999a40 to
b8a4ef4
Compare
|
Rebased on main, resolved package-lock.json conflict by regenerating it via npm install. Ready for review @Priyanshu-byte-coder ! |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Good idea — Swagger UI gives contributors a way to explore the API. Two fixes:
1. Hardcoded colors
bg-white, text-gray-900, text-gray-500 on the page — use CSS vars consistent with the rest of the app:
<main className="min-h-screen bg-[var(--background)]">
<h1 className="... text-[var(--foreground)]">
<p className="... text-[var(--muted-foreground)]">Note: swagger-ui-react injects its own CSS (swagger-ui.css) which uses hardcoded colors internally — that's out of scope, just fix the wrapper container.
2. Missing newline at EOF
api-docs/page.tsx ends without a trailing newline. Add one.
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Issues found in this PR:
- Missing EOF newline — add a trailing newline to all modified files.
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Two issues in the Swagger UI page:
-
Missing EOF newline — add a trailing newline to the page file.
-
Raw Tailwind colors break theming —
bg-white,text-gray-900,text-gray-500are hardcoded. Replace with CSS vars:bg-white→bg-[var(--background)]text-gray-900→text-[var(--foreground)]text-gray-500→text-[var(--muted-foreground)]
|
Hey @Priyanshu-byte-coder all changes made as requested ready for re-review and merge! |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
2 missing EOF newlines — all changed files must end with \n.
|
Hi @Priyanshu-byte-coder , the TypeScript errors in src/app/api/metrics/contributions/route.ts and src/app/api/metrics/issues/route.ts are pre-existing issues on the main branch confirmed by git diff upstream/main showing zero changes to these files in this PR. These errors exist on main independently of my changes. |
…track into feat/openapi-docs
|
Hey @Priyanshu-byte-coder, Regenerated package-lock.json with all swagger-ui-react dependencies included. CI should pass now triggered a rerun. Ready to merge! |
|
This PR has merge conflicts with |
|
@Priyanshu-byte-coder i have resolved the merge conflicts. |
|
Resolved in a clean rebase opened new PR #1000 based on latest main. Closing this one. |
Summary
Adds an OpenAPI 3.1 spec and interactive Swagger UI docs page for all ~20 DevTrack API routes. New contributors can now explore, understand, and test all endpoints from a single interactive page at
/api-docs.Closes #241
Type of Change
Changes Made
public/openapi.yaml— full OpenAPI 3.1 spec documenting all API routes across Auth, Badges, Goals, Metrics, Public, Streak and User groupssrc/app/api-docs/page.tsx— interactive Swagger UI page served at/api-docsswagger-ui-reactand@types/swagger-ui-reactHow to Test
npm installnpm run devhttp://localhost:3000/api-docsScreenshots (if UI change)
Checklist
npm run lintpasses locally