Skip to content

docs(openrpc): add method-level examples to generated schema#1390

Open
Minhcardanian wants to merge 6 commits intomidnightntwrk:mainfrom
Minhcardanian:issue-1369-openrpc-examples
Open

docs(openrpc): add method-level examples to generated schema#1390
Minhcardanian wants to merge 6 commits intomidnightntwrk:mainfrom
Minhcardanian:issue-1369-openrpc-examples

Conversation

@Minhcardanian
Copy link
Copy Markdown

Overview

Adds method-level OpenRPC examples to the generated schema so OpenRPC Playground / Inspector can prefill requests and display concrete examples for all emitted methods.

This change updates the OpenRPC schema generator in node/src/openrpc.rs, regenerates docs/openrpc.json, and adds a regression test asserting that every emitted method includes a non-empty examples array with params and result.

No runtime behavior, RPC semantics, method inventory, or versioning changes are included.

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason: skipped because this change only affects generated OpenRPC documentation/schema output and related generator/test coverage; no runtime/user-facing behavior change
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

Additional validation performed locally:

  • cargo fmt --check -p midnight-node
  • python3 -m json.tool docs/openrpc.json >/tmp/openrpc.valid
  • git diff --check -- docs/openrpc.json node/src/openrpc.rs

Additionally verified:

  • method count: 68
  • methods missing examples: 0

Local environment limitation:

  • cargo test -p midnight-node --lib openrpc::tests could not complete because protoc was unavailable
  • nix develop . -c cargo test -p midnight-node --lib openrpc::tests got past protoc but failed in the midnight-node-runtime build script because libstdc++.so.6 was not available in the dynamic linker path

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other: documentation/schema generator update only
  • N/A

Links

@Minhcardanian Minhcardanian requested a review from a team as a code owner April 23, 2026 02:15
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 23, 2026

CLA assistant check
All committers have signed the CLA.

@Minhcardanian Minhcardanian force-pushed the issue-1369-openrpc-examples branch from 50b0915 to 736848c Compare April 23, 2026 02:16
Signed-off-by: Minhcardanian <markbuicadarnian@gmail.com>
@Minhcardanian Minhcardanian force-pushed the issue-1369-openrpc-examples branch from 736848c to a62ff06 Compare April 23, 2026 02:19
@Minhcardanian Minhcardanian force-pushed the issue-1369-openrpc-examples branch from ae47b24 to 845cf66 Compare May 9, 2026 07:26
Signed-off-by: Minhcardanian <markbuicadarnian@gmail.com>
Signed-off-by: Minhcardanian <markbuicadarnian@gmail.com>
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