Skip to content

Generate RPC method pages from the OpenRPC specs - #3058

Merged
kaankacar merged 2 commits into
stellar:mainfrom
ElliotFriend:feat/rpc-method-generator
Nov 5, 2026
Merged

kaankacar merged 2 commits into
stellar:mainfrom
ElliotFriend:feat/rpc-method-generator

Conversation

@ElliotFriend

Copy link
Copy Markdown
Contributor

Adds the OpenRPC method page generator that was deferred during the Mintlify migration, and a CI check that keeps the specs and method pages in sync with the spec sources.

Generator

  • openrpc/scripts/docs.mjs renders each method in the built specs (stellar-rpc, stellar-rpc-beta, and anchor-platform) into its page. It rewrites only the part between the rpc-method comments and leaves the frontmatter and hand-written prose alone.
  • It creates a page for a new method, flags a page whose method left the spec, and prints a reminder to update docs.json and the methods index page in both cases.
  • pnpm rpcspec:docs regenerates the pages. pnpm rpcspec:docs --check lists out-of-date pages without writing them, and is now part of pnpm check.
  • pnpm rpcspec:check rebuilds the specs and fails if the committed specs or pages differ from what the sources produce. The mintlify-checks workflow runs it.
  • CONTRIBUTING, openrpc/README.md, and the Anchor Platform contributor guide now give the real command instead of "ask a maintainer".

Against the existing specs, the generator reproduces all 36 current method pages, apart from the changes listed below.

Page changes

  • The 23 Anchor Platform method pages had description: "<RpcMethod" in their frontmatter. They now use each method's summary.
  • Array fields now show their item descriptions, which the pages dropped before: the TopicFilter and SegmentMatcher rules on getEvents, the AND rule for queryEvents filters, LedgerKey on getLedgerEntries, and the contractEventsXdr items.
  • Drift is corrected: the stale Anchor Platform spec (missing the SEP-12 link change from 🔗 SDF to Actual Repo Links #2447) is rebuilt, and a stray space before <br /> on getVersionInfo is removed.

Spec fixes (first commit)

  • The Anchor Platform method notify_transaction_recovery was named with a trailing space.
  • The topic field of getEvents result events referenced TopicFilter, the request filter type, so filter wildcard rules would render on a response field. It's now an array of strings, which is the same type.
  • The contractEventsXdr item description had a nested, broken Markdown link.

Checks

  • pnpm rpcspec:check, pnpm check:mdx, pnpm check:pad, and pnpm validate pass.
  • The generator's output is unchanged when run a second time.
  • --check fails on a hand edit inside the generated part and on an orphaned page.

🤖 Generated with Claude Code

ElliotFriend and others added 2 commits November 4, 2026 13:15
…entsXdr link

Rebuild the specs, which also picks up the SEP-12 link change from stellar#2447
in the Anchor Platform spec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add `pnpm rpcspec:docs`, which rewrites the generated part of each method
page, and `pnpm rpcspec:check`, which CI runs to catch stale specs or pages.
Regenerating fixes the Anchor Platform page descriptions and adds item
descriptions to array fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mintlify

mintlify Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 11a8e03.

Approve preview

@kaankacar kaankacar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@kaankacar
kaankacar merged commit e8c2efb into stellar:main Nov 5, 2026
5 checks passed
@ElliotFriend
ElliotFriend deleted the feat/rpc-method-generator branch November 5, 2026 16:30
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