Skip to content

Comments

feat(docs): RPC methods reference#6630

Merged
LesnyRumcajs merged 15 commits intomainfrom
rpc-reference-in-docs
Feb 24, 2026
Merged

feat(docs): RPC methods reference#6630
LesnyRumcajs merged 15 commits intomainfrom
rpc-reference-in-docs

Conversation

@LesnyRumcajs
Copy link
Member

@LesnyRumcajs LesnyRumcajs commented Feb 19, 2026

Summary of changes

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • New Features

    • Interactive JSON‑RPC explorer and searchable Methods Reference with multi‑version browsing and interactive schema details.
  • Documentation

    • Reorganized JSON‑RPC docs: added Overview, Schema Explorer, and generated Methods pages; updated internal links and ignore rules for generated artifacts.
  • Chores

    • Docs build now generates the RPC reference and includes a centralized build task; added an automated daily workflow to regenerate and update RPC reference docs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds an interactive, generated JSON‑RPC reference (scripts, TypeScript generator, React component, styles, docs pages), introduces scheduled workflow to regenerate OpenRPC specs and open PRs, and updates docs CI to use Mise tasks for building and linting; also adds ignore and prettier-ignore entries for generated artifacts.

Changes

Cohort / File(s) Summary
GitHub Actions — docs build
/.github/workflows/docs-check.yml, /.github/workflows/docs-deploy.yml
Replace explicit Node/pnpm setup and direct pnpm build steps with jdx/mise-action@v3 and mise run docs:build invocation; consolidate build via Mise.
Automated RPC docs workflow
/.github/workflows/docs-rpc-auto-update.yml
Add daily/manual workflow that generates OpenRPC specs (local or Docker), runs the generator, obtains a GitHub App token, and creates a PR updating docs/openrpc-specs/.
Docs content / structure
docs/README.md, docs/docs/users/reference/json_rpc.mdx, docs/docs/users/reference/json-rpc/_category_.json, docs/docs/users/reference/json-rpc/overview.md, docs/docs/users/reference/json-rpc/methods.mdx, docs/docs/users/reference/json-rpc/schema.mdx
Remove monolithic JSON‑RPC page, add category metadata and separate Overview/Methods/Schema pages; adjust links, frontmatter, and exported style constants in schema page.
RPC generation scripts & package
docs/scripts/generate-openrpc-specs.sh, docs/scripts/generate-rpc-reference.ts, docs/package.json
Add shell script to emit v0/v1/v2 OpenRPC JSON (local/docker), add TSX generator to build rpc-methods.json, add generate:rpc-reference script and run it as part of docs build.
RPCReference component & styles
docs/src/components/RPCReference/index.tsx, docs/src/components/RPCReference/RPCReference.module.css
Add React RPCReference default export (interactive multi-version/namespace explorer, search, deep-linking, schema renderer) and comprehensive CSS module for UI.
Mise tasks & CI integration
mise.toml
Add docs:build task and prepend pnpm generate:rpc-reference to the docs:lint task run script.
Ignore / formatting helpers
docs/.gitignore, docs/.prettierignore
Add ignore rules for generated OpenRPC specs and src/data/rpc-methods.json, and prettier ignore entries for generated/non-source files.

Sequence Diagram(s)

sequenceDiagram
    participant Scheduler as Scheduler / Manual
    participant GH as GitHub Actions
    participant Repo as Repository (checkout)
    participant Docker as Docker / forest-tool
    participant Script as generate-openrpc-specs.sh
    participant Generator as generate-rpc-reference.ts
    participant GHApp as GitHub App (Leshy)
    participant API as GitHub API / PR

    Scheduler->>GH: trigger workflow
    GH->>Repo: checkout code
    GH->>Script: run generate-openrpc-specs.sh (docker)
    Script->>Docker: invoke forest-tool image
    Docker-->>Script: produce v0.json, v1.json, v2.json
    GH->>Generator: run generate-rpc-reference.ts (tsx)
    Generator-->>Repo: write rpc-methods.json / docs/openrpc-specs/
    GH->>GHApp: request installation token (Leshy credentials)
    GHApp-->>GH: return installation token
    GH->>API: create branch, commit updated files, open PR
    API-->>GH: PR created
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

RPC

Suggested reviewers

  • hanabi1224
  • akaladarshi
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(docs): RPC methods reference' directly describes the main objective of the changeset—adding an RPC methods reference feature to the documentation, which is comprehensively implemented across multiple documentation files, components, and scripts.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rpc-reference-in-docs

Comment @coderabbitai help to get the list of available commands and usage tips.

@LesnyRumcajs
Copy link
Member Author

@coderabbitai full review

@LesnyRumcajs LesnyRumcajs marked this pull request as ready for review February 23, 2026 19:50
@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner February 23, 2026 19:50
@LesnyRumcajs LesnyRumcajs requested review from akaladarshi and hanabi1224 and removed request for a team February 23, 2026 19:50
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (2)
docs/scripts/generate-openrpc-specs.sh (1)

3-8: Minor bash safety and portability improvements.

Two small nits:

  1. set -e alone doesn't protect against unbound variable references. Adding set -euo pipefail is a common defensive pattern.
  2. == in single-bracket [ ] is a bash extension and not POSIX. Prefer = (or switch to [[ ]]).
♻️ Suggested changes
-set -e
+set -euo pipefail
 
-if [ "$1" == "local" ]; then
+if [ "$1" = "local" ]; then
   ENVIRONMENT="local"
-elif [ "$1" == "docker" ]; then
+elif [ "$1" = "docker" ]; then
   ENVIRONMENT="docker"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/scripts/generate-openrpc-specs.sh` around lines 3 - 8, Replace the
brittle shell settings and non-portable test operators: change the shebang block
to use defensive flags by replacing "set -e" with "set -euo pipefail" and update
the conditional tests that set ENVIRONMENT (the "[ \"$1\" == \"local\" ]" and "[
\"$1\" == \"docker\" ]" expressions) to use POSIX "=" (i.e. "[ \"$1\" =
\"local\" ]" and "[ \"$1\" = \"docker\" ]") so the script is safer and more
portable while still assigning ENVIRONMENT as before.
docs/package.json (1)

10-24: Consider generating RPC reference data before start.
If src/data/rpc-methods.json is missing, docusaurus start can fail. A prestart hook keeps local dev friction low.

♻️ Suggested update
 "scripts": {
   "docusaurus": "docusaurus",
-  "start": "docusaurus start",
+  "start": "docusaurus start",
+  "prestart": "pnpm generate:rpc-reference",
   "build": "pnpm generate:rpc-reference && docusaurus build",
   "swizzle": "docusaurus swizzle",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/package.json` around lines 10 - 24, Update the package.json scripts so
the dev "start" script runs the RPC generation before starting: add a "prestart"
script that invokes the existing "generate:rpc-reference" script (reference: the
"start" script and "generate:rpc-reference" script names) so that
src/data/rpc-methods.json is produced prior to running "docusaurus start";
ensure the "prestart" command is placed alongside the other scripts and does not
change the existing "start" or "generate:rpc-reference" commands.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/docs-rpc-auto-update.yml:
- Line 11: The workflow uses runs-on: ubuntu-slim which lacks Docker and has
strict time limits; change the runner to a full Ubuntu runner (e.g., replace
runs-on: ubuntu-slim with runs-on: ubuntu-latest or ubuntu-22.04) so the
generate-openrpc-specs.sh docker step can use Docker and pulls (e.g.,
ghcr.io/chainsafe/forest:edge-fat) won’t be killed by the short timeout; ensure
any job timeout or concurrency settings match other repo workflows to allow
sufficient time for the docker pulls.

In `@docs/docs/users/reference/json-rpc/overview.md`:
- Around line 46-48: The inline code example for the startup flag is broken
across a line causing MDX rendering issues; edit the paragraph containing the
inline code `--save-token <FILE>` (near the mention of `AuthNew`) to place the
entire flag example inside a single pair of backticks on one line (i.e.,
`--save-token <FILE>`), removing the line break so the inline code renders
correctly.

In `@docs/docs/users/reference/json-rpc/schema.mdx`:
- Around line 35-85: Add rel="noopener noreferrer" to every external anchor tag
that uses target="_blank" in this file; specifically update the <a> elements
linking to the playground (href values starting with
"https://playground.open-rpc.org") and the <a> elements linking to raw JSON
(href values ending with "v0.json", "v1.json", "v2.json") so each anchor
includes rel="noopener noreferrer" alongside the existing target attribute to
prevent reverse-tabnabbing.

In `@docs/src/components/RPCReference/index.tsx`:
- Around line 162-170: The schema/method toggle elements (currently a
non-focusable <code> inside a <div>) are not keyboard-accessible; replace or
augment them with proper button semantics: make the clickable element a <button>
(or add role="button" and tabIndex={0}), add onKeyDown handler that toggles on
Enter/Space, set aria-expanded={showSchema} and aria-controls pointing to the
schema panel id, keep the existing onClick={() => setShowSchema(!showSchema)}
logic, and ensure the visual span (styles.schemaToggle) remains inside the
interactive element; apply the same changes to the other similar toggle block
(the method toggle using the same typeValueClickable pattern) so both keyboard
and screen-reader users can open/close schemas and methods.

---

Nitpick comments:
In `@docs/package.json`:
- Around line 10-24: Update the package.json scripts so the dev "start" script
runs the RPC generation before starting: add a "prestart" script that invokes
the existing "generate:rpc-reference" script (reference: the "start" script and
"generate:rpc-reference" script names) so that src/data/rpc-methods.json is
produced prior to running "docusaurus start"; ensure the "prestart" command is
placed alongside the other scripts and does not change the existing "start" or
"generate:rpc-reference" commands.

In `@docs/scripts/generate-openrpc-specs.sh`:
- Around line 3-8: Replace the brittle shell settings and non-portable test
operators: change the shebang block to use defensive flags by replacing "set -e"
with "set -euo pipefail" and update the conditional tests that set ENVIRONMENT
(the "[ \"$1\" == \"local\" ]" and "[ \"$1\" == \"docker\" ]" expressions) to
use POSIX "=" (i.e. "[ \"$1\" = \"local\" ]" and "[ \"$1\" = \"docker\" ]") so
the script is safer and more portable while still assigning ENVIRONMENT as
before.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a2f11be and 07170cd.

⛔ Files ignored due to path filters (1)
  • docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .github/workflows/docs-check.yml
  • .github/workflows/docs-deploy.yml
  • .github/workflows/docs-rpc-auto-update.yml
  • docs/.gitignore
  • docs/.prettierignore
  • docs/README.md
  • docs/docs/users/reference/json-rpc/_category_.json
  • docs/docs/users/reference/json-rpc/methods.mdx
  • docs/docs/users/reference/json-rpc/overview.md
  • docs/docs/users/reference/json-rpc/schema.mdx
  • docs/docs/users/reference/json_rpc.mdx
  • docs/openrpc-specs/v0.json
  • docs/openrpc-specs/v1.json
  • docs/openrpc-specs/v2.json
  • docs/package.json
  • docs/scripts/generate-openrpc-specs.sh
  • docs/scripts/generate-rpc-reference.ts
  • docs/src/components/RPCReference/RPCReference.module.css
  • docs/src/components/RPCReference/index.tsx
  • mise.toml
💤 Files with no reviewable changes (2)
  • docs/README.md
  • docs/docs/users/reference/json_rpc.mdx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (2)
docs/src/components/RPCReference/index.tsx (2)

458-466: Method header keyboard accessibility is properly implemented.

All required ARIA attributes and key handlers are in place on the method toggle <div>.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/components/RPCReference/index.tsx` around lines 458 - 466, The
reviewer confirms keyboard accessibility is correctly implemented for the method
header (the <div> with className styles.methodHeader using toggleMethod and
handleMethodKeyDown), so no code changes are required; resolve the comment and
remove the duplicate review note from the PR thread to avoid confusion, leaving
the existing attributes (onClick, onKeyDown, role="button", tabIndex,
aria-expanded, aria-controls) and handlers intact.

171-184: Keyboard accessibility for schema toggle is now properly implemented.

role="button", tabIndex={0}, aria-expanded, aria-controls, and onKeyDown are all in place. Matches the fix requested in the previous review.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/components/RPCReference/index.tsx` around lines 171 - 184, The PR
comment contains duplicate review annotations—remove the duplicated tokens
([approve_code_changes] and [duplicate_comment]) so only one approval/comment
remains; while here, confirm the interactive element uses the existing handlers
and IDs correctly by ensuring setShowSchema and handleKeyDown are defined and
imported/declared, schemaId is stable/unique for aria-controls, and the
clickable element (styles.typeValueClickable) renders the typeName and schema
toggle as shown.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/src/components/RPCReference/index.tsx`:
- Around line 279-286: The copyMethodLink function currently calls
navigator.clipboard.writeText(...) without handling rejection; update
copyMethodLink to handle write failures by adding a .catch handler (or try/catch
if using async/await) on the writeText promise, log or surface an error via
setCopiedMethod or another state (e.g., setCopiedMethod('error') / setCopyError)
and optionally provide a fallback (selecting a hidden input and
document.execCommand('copy')) so the user receives feedback when clipboard
access is denied. Ensure the change is applied within copyMethodLink and
preserves the existing success path that calls setCopiedMethod(methodName) and
the timeout to clear it.
- Around line 218-277: The hash handler re-runs on every selectedVersion change
and overrides user changes; fix by making a stable handler that reads the latest
version from a ref instead of depending on selectedVersion in the effect: create
selectedVersionRef and update it in a short useEffect
(selectedVersionRef.current = selectedVersion), then register handleHashChange
in a mount-only useEffect (empty deps) which reads currentVersion =
selectedVersionRef.current, calls setSelectedVersion(version) and also
setSelectedNamespace("all") when switching versions, updates setExpandedMethods
for methods, and performs the scroll; keep the initial handleHashChange() call
on mount and leave hashchange listener registration/cleanup in that mount-only
effect.
- Line 199: The destructured variable siteConfig is unused after calling
useDocusaurusContext() in the RPCReference component; remove the dead code by
deleting the siteConfig destructuring (i.e., change "const { siteConfig } =
useDocusaurusContext();" to just call useDocusaurusContext() without extracting
siteConfig or remove the call entirely if the hook isn't needed), and if the
only import of useDocusaurusContext is for siteConfig, also remove the unused
import to keep the module clean.

---

Duplicate comments:
In `@docs/src/components/RPCReference/index.tsx`:
- Around line 458-466: The reviewer confirms keyboard accessibility is correctly
implemented for the method header (the <div> with className styles.methodHeader
using toggleMethod and handleMethodKeyDown), so no code changes are required;
resolve the comment and remove the duplicate review note from the PR thread to
avoid confusion, leaving the existing attributes (onClick, onKeyDown,
role="button", tabIndex, aria-expanded, aria-controls) and handlers intact.
- Around line 171-184: The PR comment contains duplicate review
annotations—remove the duplicated tokens ([approve_code_changes] and
[duplicate_comment]) so only one approval/comment remains; while here, confirm
the interactive element uses the existing handlers and IDs correctly by ensuring
setShowSchema and handleKeyDown are defined and imported/declared, schemaId is
stable/unique for aria-controls, and the clickable element
(styles.typeValueClickable) renders the typeName and schema toggle as shown.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07170cd and 3382d4c.

📒 Files selected for processing (2)
  • docs/docs/users/reference/json-rpc/schema.mdx
  • docs/src/components/RPCReference/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/docs/users/reference/json-rpc/schema.mdx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/src/components/RPCReference/index.tsx (1)

86-133: Avoid invalid inline/block nesting in schema rendering.

renderSchemaContent can return <div> for objects, but the array/anyOf branches wrap content in <span>, which can yield <span><div>…</div></span> and cause layout quirks. Consider using fragments so block elements aren’t nested inside inline wrappers.

♻️ Suggested adjustment
-    if (sch.type === "array" && sch.items) {
-      return (
-        <span>Array&lt;{renderSchemaContent(sch.items, depth + 1)}&gt;</span>
-      );
-    }
+    if (sch.type === "array" && sch.items) {
+      return (
+        <>
+          <span>Array&lt;</span>
+          {renderSchemaContent(sch.items, depth + 1)}
+          <span>&gt;</span>
+        </>
+      );
+    }
@@
-    if (sch.anyOf || sch.oneOf) {
-      const variants = sch.anyOf || sch.oneOf;
-      return (
-        <span>
-          {variants.map((v: any, i: number) => (
-            <span key={i}>
-              {i > 0 && " | "}
-              {renderSchemaContent(v, depth + 1)}
-            </span>
-          ))}
-        </span>
-      );
-    }
+    if (sch.anyOf || sch.oneOf) {
+      const variants = sch.anyOf || sch.oneOf;
+      return (
+        <>
+          {variants.map((v: any, i: number) => (
+            <React.Fragment key={i}>
+              {i > 0 && " | "}
+              {renderSchemaContent(v, depth + 1)}
+            </React.Fragment>
+          ))}
+        </>
+      );
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/components/RPCReference/index.tsx` around lines 86 - 133, The array
and anyOf/oneOf branches in renderSchemaContent wrap results in <span> which can
end up containing block-level output from the object branch (a <div>), causing
invalid nesting; change those branches to return a neutral wrapper (use React
fragments or a <div> instead of <span>) so block elements from the object case
are not placed inside inline elements—update the array branch (where sch.type
=== "array") and the anyOf/oneOf branch (where variants = sch.anyOf ||
sch.oneOf) to use fragments/blocks when rendering renderSchemaContent(sch.items,
...) and renderSchemaContent(v, ...).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/src/components/RPCReference/index.tsx`:
- Around line 231-274: Validate that the parsed version from the hash exists
before calling setSelectedVersion: in handleHashChange, after computing version
check it against the known versions/currentVersion (e.g., compare to
currentVersion or an availableVersions list) and if unknown fall back to
currentVersion (or currentVersionRef.current) instead of setting an invalid
value; for method- hashes always call setSelectedNamespace("all") so the method
can be visible even when a namespace filter is active; apply the same version
validation for namespace- hashes before calling setSelectedVersion and only set
the parsed namespace after the version is confirmed.
- Around line 294-321: The fallback in copyMethodLink treats
document.execCommand("copy") as always successful; change the catch-block
fallback so you capture the boolean return of document.execCommand("copy") and
only call setCopiedMethod(methodName) (and schedule clear) when that return is
true, otherwise call setCopiedMethod("error") (and schedule clear); also ensure
the temporary textarea is removed in a finally-like path after attempting
execCommand; update references in the catch block around execCommand("copy")
inside copyMethodLink accordingly.

---

Nitpick comments:
In `@docs/src/components/RPCReference/index.tsx`:
- Around line 86-133: The array and anyOf/oneOf branches in renderSchemaContent
wrap results in <span> which can end up containing block-level output from the
object branch (a <div>), causing invalid nesting; change those branches to
return a neutral wrapper (use React fragments or a <div> instead of <span>) so
block elements from the object case are not placed inside inline elements—update
the array branch (where sch.type === "array") and the anyOf/oneOf branch (where
variants = sch.anyOf || sch.oneOf) to use fragments/blocks when rendering
renderSchemaContent(sch.items, ...) and renderSchemaContent(v, ...).

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3382d4c and 0573185.

📒 Files selected for processing (1)
  • docs/src/components/RPCReference/index.tsx

This file is no longer needed as OpenRPC specs are now auto-generated
and stored in openrpc-specs/ directory (v0.json, v1.json, v2.json).
Make schema and method toggles keyboard-accessible:
- Add role="button", tabIndex={0} for keyboard focus
- Add onKeyDown handlers for Enter/Space key activation
- Add aria-expanded to indicate toggle state
- Add aria-controls linking to expanded content IDs
- Wrap expanded content in divs with proper IDs

Both keyboard and screen-reader users can now open/close schemas
and methods using standard keyboard navigation.
Add security attributes to all external links with target="_blank":
- Links to OpenRPC playground
- Links to raw JSON spec files

This prevents reverse-tabnabbing security vulnerabilities where
opened pages could potentially access the window.opener object.
- Use ref to track selectedVersion to avoid re-running hash handler on version changes
- Make hash handler mount-only (empty deps array)
- Reset namespace filter to 'all' when switching versions via hash
- Add clipboard error handling with execCommand fallback
- Remove unused useDocusaurusContext import
- Validate hash version against available versions before setting
- Always reset namespace filter to 'all' for method hashes
- Check execCommand return value for clipboard fallback
- Use fragments instead of spans to avoid invalid HTML nesting
- Add finally block to ensure textarea cleanup
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
docs/docs/users/reference/json-rpc/overview.md (1)

46-47: ⚠️ Potential issue | 🟡 Minor

Inline code for --save-token <FILE> is still split across two lines.

The backtick-delimited code span opens on line 46 and closes on line 47, which can render as two separate tokens or produce unexpected whitespace in MDX.

💡 Suggested fix
-Authentication is performed via [JWT Tokens](../../knowledge_base/jwt_handling.md). When starting Forest use `--save-token 
-<FILE>` to store an `Admin` token,
+Authentication is performed via [JWT Tokens](../../knowledge_base/jwt_handling.md). When starting Forest use `--save-token <FILE>` to store an `Admin` token,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/docs/users/reference/json-rpc/overview.md` around lines 46 - 47, The
inline code span for `--save-token <FILE>` is split across two lines, causing
MDX rendering issues; fix by placing the entire backtick-delimited span on a
single line so the opening and closing backticks surround the full token
(`--save-token <FILE>`) within the same line in the overview text (search for
the existing `--save-token` token in the paragraph near the JWT Tokens
sentence).
🧹 Nitpick comments (1)
docs/scripts/generate-rpc-reference.ts (1)

90-93: components parameter in resolveSchemaType is unused dead code.

components is threaded through every recursive call but is never dereferenced inside the function — $ref values are only name-extracted (line 100-101), never resolved against the components map. Either use it to fully resolve refs or remove the parameter.

♻️ Proposed cleanup
 function resolveSchemaType(
   schema: any,
-  components?: Record<string, any>,
 ): string {
   ...
   if (schema.anyOf) {
-    const types = schema.anyOf.map((s: any) => resolveSchemaType(s, components));
+    const types = schema.anyOf.map((s: any) => resolveSchemaType(s));
   ...
   if (schema.oneOf) {
-    const types = schema.oneOf.map((s: any) => resolveSchemaType(s, components));
+    const types = schema.oneOf.map((s: any) => resolveSchemaType(s));
   ...
   if (schema.type === "array" && schema.items) {
-    const itemType = resolveSchemaType(schema.items, components);
+    const itemType = resolveSchemaType(schema.items);

And update call-sites at lines 201 and 206 to drop the second argument.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/scripts/generate-rpc-reference.ts` around lines 90 - 93, The optional
components parameter on resolveSchemaType is dead — remove the components
parameter from the resolveSchemaType signature, delete any extra argument
passing of components inside its recursive calls, and update every call-site
that currently calls resolveSchemaType(..., components) to call
resolveSchemaType(...) with a single argument; ensure no leftover references to
components remain in the function body or callers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/src/components/RPCReference/index.tsx`:
- Around line 329-344: The error path sets setCopiedMethod("error") but the UI
only checks copiedMethod === method.name, so failures aren't shown; change the
state from a plain string to an object like { name: string|null, status:
"success"|"error"|null } (or similar) and update the copy handler (the function
that creates/removes the textarea and calls setCopiedMethod) to set {name:
methodName, status: "success"} on success and {name: methodName, status:
"error"} on failure, and then update the button rendering logic (the check that
currently compares copiedMethod === method.name) to inspect copiedMethod.name
and copiedMethod.status so it can render the "⚠" error indicator scoped to the
clicked method; ensure all other uses of copiedMethod and setCopiedMethod are
updated to the new shape.

---

Duplicate comments:
In `@docs/docs/users/reference/json-rpc/overview.md`:
- Around line 46-47: The inline code span for `--save-token <FILE>` is split
across two lines, causing MDX rendering issues; fix by placing the entire
backtick-delimited span on a single line so the opening and closing backticks
surround the full token (`--save-token <FILE>`) within the same line in the
overview text (search for the existing `--save-token` token in the paragraph
near the JWT Tokens sentence).

---

Nitpick comments:
In `@docs/scripts/generate-rpc-reference.ts`:
- Around line 90-93: The optional components parameter on resolveSchemaType is
dead — remove the components parameter from the resolveSchemaType signature,
delete any extra argument passing of components inside its recursive calls, and
update every call-site that currently calls resolveSchemaType(..., components)
to call resolveSchemaType(...) with a single argument; ensure no leftover
references to components remain in the function body or callers.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72e2c97 and ecd1bdd.

⛔ Files ignored due to path filters (1)
  • docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .github/workflows/docs-check.yml
  • .github/workflows/docs-deploy.yml
  • .github/workflows/docs-rpc-auto-update.yml
  • docs/.gitignore
  • docs/.prettierignore
  • docs/README.md
  • docs/docs/users/reference/json-rpc/_category_.json
  • docs/docs/users/reference/json-rpc/methods.mdx
  • docs/docs/users/reference/json-rpc/overview.md
  • docs/docs/users/reference/json-rpc/schema.mdx
  • docs/docs/users/reference/json_rpc.mdx
  • docs/openrpc-specs/v0.json
  • docs/openrpc-specs/v1.json
  • docs/openrpc-specs/v2.json
  • docs/package.json
  • docs/scripts/generate-openrpc-specs.sh
  • docs/scripts/generate-rpc-reference.ts
  • docs/src/components/RPCReference/RPCReference.module.css
  • docs/src/components/RPCReference/index.tsx
  • mise.toml
💤 Files with no reviewable changes (2)
  • docs/docs/users/reference/json_rpc.mdx
  • docs/README.md
✅ Files skipped from review due to trivial changes (1)
  • docs/.gitignore
🚧 Files skipped from review as they are similar to previous changes (8)
  • docs/package.json
  • docs/.prettierignore
  • .github/workflows/docs-deploy.yml
  • .github/workflows/docs-rpc-auto-update.yml
  • docs/docs/users/reference/json-rpc/category.json
  • docs/scripts/generate-openrpc-specs.sh
  • docs/src/components/RPCReference/RPCReference.module.css
  • .github/workflows/docs-check.yml

- Change copiedMethod state to object with status field
- Show ⚠ warning icon when clipboard copy fails
- Fix split backtick in overview.md MDX
- Remove unused components parameter from resolveSchemaType
@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 442e716 Feb 24, 2026
47 checks passed
@LesnyRumcajs LesnyRumcajs deleted the rpc-reference-in-docs branch February 24, 2026 14:22
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