feat: scalar api documentation#31
Conversation
- Loaded the scalar standalone api doc script from its cdn - Used scalar api doc as the default api documentation in the root url - Moved the redocly cli doc under /docs/redoc
- Update @redocly/cli 2.28.1 -> 2.29.1 - Update mongoose 9.4.1 -> 9.5.0 - Update typescript-eslint 8.58.2 -> 8.59.0 - Bump to version minor v1.2.0
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 54 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces a Scalar API reference UI alongside existing documentation options. Changes include updating README documentation links, adding a new Scalar UI page mounted at Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
README.md (2)
328-330:⚠️ Potential issue | 🟡 MinorFix the documented Redoc output path.
Line 330 still says
docs:buildwrites to/server/public/index.html, butserver/package.jsonnow writes Redoc to/server/public/docs/redoc/index.html.📝 Proposed README update
-Builds the API documentation using the [Redocly CLI](https://www.npmjs.com/package/@redocly/cli) into the `/server/public/index.html` file. +Builds the API documentation using the [Redocly CLI](https://www.npmjs.com/package/@redocly/cli) into the `/server/public/docs/redoc/index.html` file.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 328 - 330, Update the README entry for the npm script `docs:build` to reflect the current output path used by the `server/package.json` script: change the documented Redoc output from `/server/public/index.html` to `/server/public/docs/redoc/index.html` and ensure the description references the Redocly CLI (`@redocly/cli`) building into that new path.
72-83:⚠️ Potential issue | 🟡 MinorUpdate the dependency versions in the README table.
The manifest now uses Mongoose
9.5.0and@redocly/cli2.29.1, but Lines 75 and 82 still document the previous versions.📝 Proposed README update
-| Mongoose | `9.4.1` | ODM for MongoDB that provides schema-based modeling and data interaction. | +| Mongoose | `9.5.0` | ODM for MongoDB that provides schema-based modeling and data interaction. | ... -| `@redocly/cli` | `2.28.1` | Generates an API documentation using an OpenAPI YAML input. | +| `@redocly/cli` | `2.29.1` | Generates an API documentation using an OpenAPI YAML input. |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 72 - 83, Update the README dependency table to reflect the manifest changes: change the Mongoose version in the table entry for "Mongoose" from `9.4.1` to `9.5.0` and change the `@redocly/cli` version in the table entry for "@redocly/cli" from `2.28.1` to `2.29.1` so the documented versions match the project's manifest.
🧹 Nitpick comments (1)
server/public/index.html (1)
18-20: Drop the Scalar proxy for the same-origin spec.
/openapi.jsondefines API endpoints athttp://localhost:3001, which are same-origin relative to the Scalar page. For same-origin endpoints and localhost targets, the proxy is unused; Scalar's implementation automatically skips proxying for localhost.♻️ Proposed simplification
Scalar.createApiReference('#app', { // The URL of the OpenAPI/Swagger document - url: '/openapi.json', - // Avoid CORS issues - proxyUrl: 'https://proxy.scalar.com', + url: '/openapi.json' })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@server/public/index.html` around lines 18 - 20, The OpenAPI config sets url: '/openapi.json' but also specifies proxyUrl: 'https://proxy.scalar.com'; remove the proxyUrl entry (or leave it undefined) so the same-origin localhost spec uses no Scalar proxy. Locate the block where url: '/openapi.json' and proxyUrl are defined in server/public/index.html and delete the proxyUrl: 'https://proxy.scalar.com' line (or set proxyUrl to null/undefined) to simplify the config.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@server/public/index.html`:
- Around line 11-12: Replace the unpinned CDN script tag that currently uses
"https://cdn.jsdelivr.net/npm/@scalar/api-reference" with a version-pinned URL
and include SRI and CORS attributes: update the script element (the <script
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"> tag) to point to the
tested release (e.g., append `@x.y.z`), add an integrity="sha384-..." attribute
with the computed SRI hash for that file and add crossorigin="anonymous";
alternatively, download and serve the asset from your own static files and
update the script tag to reference the local file instead.
In `@server/src/scripts/openapi/docs/api.info.ts`:
- Line 13: The description string in api.info.ts currently embeds Markdown-style
links inside an HTML <ul><li> block which some OpenAPI renderers may show as
literal text; update the description (the description constant/object where
BASE_API_URL is interpolated) to use either pure Markdown list syntax (e.g., "-
Interactive (Scalar): [BASE_API_URL](...)" ) or convert the HTML list items to
use HTML anchor tags (e.g., <li><a
href="${BASE_API_URL}">${BASE_API_URL}</a></li>) so links render correctly; keep
the BASE_API_URL interpolations intact and ensure the chosen format is
consistent across the three list items.
---
Outside diff comments:
In `@README.md`:
- Around line 328-330: Update the README entry for the npm script `docs:build`
to reflect the current output path used by the `server/package.json` script:
change the documented Redoc output from `/server/public/index.html` to
`/server/public/docs/redoc/index.html` and ensure the description references the
Redocly CLI (`@redocly/cli`) building into that new path.
- Around line 72-83: Update the README dependency table to reflect the manifest
changes: change the Mongoose version in the table entry for "Mongoose" from
`9.4.1` to `9.5.0` and change the `@redocly/cli` version in the table entry for
"@redocly/cli" from `2.28.1` to `2.29.1` so the documented versions match the
project's manifest.
---
Nitpick comments:
In `@server/public/index.html`:
- Around line 18-20: The OpenAPI config sets url: '/openapi.json' but also
specifies proxyUrl: 'https://proxy.scalar.com'; remove the proxyUrl entry (or
leave it undefined) so the same-origin localhost spec uses no Scalar proxy.
Locate the block where url: '/openapi.json' and proxyUrl are defined in
server/public/index.html and delete the proxyUrl: 'https://proxy.scalar.com'
line (or set proxyUrl to null/undefined) to simplify the config.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 57eed64f-e48f-49bd-8eeb-ce710455e550
⛔ Files ignored due to path filters (1)
server/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
README.mdserver/package.jsonserver/public/docs/redoc/index.htmlserver/public/index.htmlserver/public/openapi.jsonserver/public/openapi.yamlserver/src/scripts/openapi/docs/api.info.ts
Summary
/, #22/docs/redocrouteLibrary Updates
Related Issues
Type of Change
Checklist
Summary by CodeRabbit
New Features
Documentation
Chores