Skip to content

Comments

feat(docs): RPC methods reference#6630

Open
LesnyRumcajs wants to merge 10 commits intomainfrom
rpc-reference-in-docs
Open

feat(docs): RPC methods reference#6630
LesnyRumcajs wants to merge 10 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

    • Added interactive JSON-RPC documentation with a Schema Explorer for browsing API specifications and a Methods Reference for detailed method information.
    • Implemented automated daily updates to RPC reference documentation.
  • Documentation

    • Reorganized JSON-RPC documentation structure for improved navigation and discoverability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

Walkthrough

Reorganizes JSON-RPC documentation into a structured directory with separate pages. Introduces automated workflows and scripts to generate OpenRPC specifications and RPC reference data from OpenRPC specs. Adds a React component for interactive RPC method exploration. Updates CI workflows and configuration to use Mise for documentation tasks.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Updates
.github/workflows/docs-check.yml, .github/workflows/docs-deploy.yml
Replaces explicit Node and pnpm setup steps with jdx/mise-action@v3 to invoke mise run docs:build, unifying build command execution via Mise.
Automated RPC Documentation Workflow
.github/workflows/docs-rpc-auto-update.yml
New workflow that runs daily and on-demand to generate OpenRPC specs via Docker, obtain GitHub App token, and open automated PRs to update Forest RPC reference documentation.
JSON-RPC Documentation Restructuring
docs/docs/users/reference/json_rpc.mdx, docs/docs/users/reference/json-rpc/*, docs/README.md
Removes monolithic JSON-RPC doc file and redistributes content across new directory structure: overview.md, methods.mdx, schema.mdx, and category.json metadata file.
RPC Generation Scripts
docs/scripts/generate-openrpc-specs.sh, docs/scripts/generate-rpc-reference.ts
Adds shell script to generate OpenRPC v0/v1/v2 specs locally or via Docker; adds TypeScript script to parse specs, resolve schema types, and emit structured RPC reference data for component consumption.
RPCReference React Component
docs/src/components/RPCReference/index.tsx, docs/src/components/RPCReference/RPCReference.module.css
Implements interactive RPC method explorer component with version/namespace selection, search, parameter/return type rendering, schema visualization, and hash-based navigation for deep linking.
Build Configuration Updates
docs/package.json, mise.toml, docs/.gitignore, docs/.prettierignore
Adds generate:rpc-reference script and dependencies (tsx, @types/node); updates build pipeline to run generation before build; adds Mise tasks for docs build and lint; defines ignore patterns for generated and build artifacts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

  • chore: move from Makefile to mise #6368: Introduces the Mise-based task system that this PR extends by adding docs:build and docs:lint tasks and migrating GitHub Actions to use Mise instead of explicit pnpm steps.
  • fix: docs linting #6452: Updates GitHub Actions and mise configuration to expose and invoke docs-related tasks, aligning with this PR's refactoring of documentation build automation.

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 accurately and concisely describes the main change—adding RPC methods reference documentation with a new interactive component and supporting infrastructure.
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 docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 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

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).
@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 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


jobs:
update-docs:
runs-on: ubuntu-slim
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

ubuntu-slim lacks Docker and runs unprivileged — this job will fail.

The ubuntu-slim runner executes workflows inside a container rather than a full VM instance. This means operations requiring elevated privileges — such as Docker-in-Docker — are not supported. Docker CLI is absent from ubuntu-slim, and there are open upstream requests to add it. The generate-openrpc-specs.sh docker step called at line 17 will fail with "docker: command not found".

Additionally, the job timeout for ubuntu-slim runners is 15 minutes, and the job is terminated and fails if it reaches this limit — tight for pulling ghcr.io/chainsafe/forest:edge-fat three times.

Use a full Ubuntu runner consistent with other workflows in this repo:

-    runs-on: ubuntu-slim
+    runs-on: ubuntu-24.04
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
runs-on: ubuntu-slim
runs-on: ubuntu-24.04
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/docs-rpc-auto-update.yml at 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.

Comment on lines +46 to 48
Authentication is performed via [JWT Tokens](../../knowledge_base/jwt_handling.md). When starting Forest use `--save-token
<FILE>` to store an `Admin` token,
otherwise the token will be printed in the logs during startup. With this token you can call the methods `AuthNew`
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Keep the inline flag example on a single line.
The line break inside inline code can render oddly in MDX.

💡 Suggested tweak
-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,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Authentication is performed via [JWT Tokens](../../knowledge_base/jwt_handling.md). When starting Forest use `--save-token
<FILE>` to store an `Admin` token,
otherwise the token will be printed in the logs during startup. With this token you can call the methods `AuthNew`
Authentication is performed via [JWT Tokens](../../knowledge_base/jwt_handling.md). When starting Forest use `--save-token <FILE>` to store an `Admin` token,
otherwise the token will be printed in the logs during startup. With this token you can call the methods `AuthNew`
🤖 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 - 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.

Comment on lines +35 to +85
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v0&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v0.json"
target="_blank"
style={style}
>
👉 View v0 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v0.json"
target="_blank"
>
📄 Raw v0 Spec (JSON)
</a>
</div>

<div style={versionCard}>
<h3>RPC v1 API</h3>
<p>Stable API - Recommended for production use</p>
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v1&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v1.json"
target="_blank"
style={style}
>
👉 View v1 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v1.json"
target="_blank"
>
📄 Raw v1 Spec (JSON)
</a>
</div>

<div style={versionCard}>
<h3>RPC v2 API</h3>
<p>Experimental API</p>
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v2&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v2.json"
target="_blank"
style={style}
>
👉 View v2 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v2.json"
target="_blank"
>
📄 Raw v2 Spec (JSON)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add rel="noopener noreferrer" to external links.
This prevents reverse-tabnabbing when using target="_blank".

🔐 Suggested fix
     <a
       href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v0&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v0.json"
       target="_blank"
+      rel="noopener noreferrer"
       style={style}
     >
@@
     <a
       href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v0.json"
       target="_blank"
+      rel="noopener noreferrer"
     >
@@
   <a
     href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v1&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v1.json"
     target="_blank"
+    rel="noopener noreferrer"
     style={style}
   >
@@
   <a
     href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v1.json"
     target="_blank"
+    rel="noopener noreferrer"
   >
@@
     <a
       href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v2&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v2.json"
       target="_blank"
+      rel="noopener noreferrer"
       style={style}
     >
@@
     <a
       href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v2.json"
       target="_blank"
+      rel="noopener noreferrer"
     >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v0&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v0.json"
target="_blank"
style={style}
>
👉 View v0 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v0.json"
target="_blank"
>
📄 Raw v0 Spec (JSON)
</a>
</div>
<div style={versionCard}>
<h3>RPC v1 API</h3>
<p>Stable API - Recommended for production use</p>
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v1&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v1.json"
target="_blank"
style={style}
>
👉 View v1 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v1.json"
target="_blank"
>
📄 Raw v1 Spec (JSON)
</a>
</div>
<div style={versionCard}>
<h3>RPC v2 API</h3>
<p>Experimental API</p>
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v2&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v2.json"
target="_blank"
style={style}
>
👉 View v2 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v2.json"
target="_blank"
>
📄 Raw v2 Spec (JSON)
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v0&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v0.json"
target="_blank"
rel="noopener noreferrer"
style={style}
>
👉 View v0 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v0.json"
target="_blank"
rel="noopener noreferrer"
>
📄 Raw v0 Spec (JSON)
</a>
</div>
<div style={versionCard}>
<h3>RPC v1 API</h3>
<p>Stable API - Recommended for production use</p>
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v1&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v1.json"
target="_blank"
rel="noopener noreferrer"
style={style}
>
👉 View v1 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v1.json"
target="_blank"
rel="noopener noreferrer"
>
📄 Raw v1 Spec (JSON)
</a>
</div>
<div style={versionCard}>
<h3>RPC v2 API</h3>
<p>Experimental API</p>
<a
href="https://playground.open-rpc.org/?uiSchema[appBar][ui:darkMode]=true&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:title]=Forest%20RPC%20v2&schemaUrl=https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v2.json"
target="_blank"
rel="noopener noreferrer"
style={style}
>
👉 View v2 Spec in Schema Explorer
</a>
<br />
<a
href="https://raw.githubusercontent.com/ChainSafe/forest/main/docs/openrpc-specs/v2.json"
target="_blank"
rel="noopener noreferrer"
>
📄 Raw v2 Spec (JSON)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/docs/users/reference/json-rpc/schema.mdx` around lines 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.

Comment on lines +162 to +170
<div className={styles.typeWithSchema}>
<code
className={styles.typeValueClickable}
onClick={() => setShowSchema(!showSchema)}
title="Click to show schema details"
>
{typeName}
<span className={styles.schemaToggle}>{showSchema ? " ▼" : " ▶"}</span>
</code>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Make the schema and method toggles keyboard-accessible.
<code> and <div> with onClick aren’t focusable by default, so keyboard users can’t expand schemas or methods. Add button semantics and key handlers.

♿ Suggested fix
       <code
         className={styles.typeValueClickable}
-        onClick={() => setShowSchema(!showSchema)}
+        role="button"
+        tabIndex={0}
+        aria-expanded={showSchema}
+        onKeyDown={(e) => {
+          if (e.key === "Enter" || e.key === " ") {
+            e.preventDefault();
+            setShowSchema((prev) => !prev);
+          }
+        }}
+        onClick={() => setShowSchema((prev) => !prev)}
         title="Click to show schema details"
       >
                     <div
                       className={styles.methodHeader}
-                      onClick={() => toggleMethod(method.name)}
+                      role="button"
+                      tabIndex={0}
+                      aria-expanded={isExpanded}
+                      onKeyDown={(e) => {
+                        if (e.key === "Enter" || e.key === " ") {
+                          e.preventDefault();
+                          toggleMethod(method.name);
+                        }
+                      }}
+                      onClick={() => toggleMethod(method.name)}
                     >

Also applies to: 432-436

🤖 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 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.

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.

1 participant