docs(openrpc): add method-level examples to generated schema#1390
Open
Minhcardanian wants to merge 6 commits intomidnightntwrk:mainfrom
Open
docs(openrpc): add method-level examples to generated schema#1390Minhcardanian wants to merge 6 commits intomidnightntwrk:mainfrom
Minhcardanian wants to merge 6 commits intomidnightntwrk:mainfrom
Conversation
50b0915 to
736848c
Compare
Signed-off-by: Minhcardanian <markbuicadarnian@gmail.com>
736848c to
a62ff06
Compare
Signed-off-by: Minhcardanian <markbuicadarnian@gmail.com>
ae47b24 to
845cf66
Compare
Signed-off-by: Minhcardanian <markbuicadarnian@gmail.com>
Signed-off-by: Minhcardanian <markbuicadarnian@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, regeneratesdocs/openrpc.json, and adds a regression test asserting that every emitted method includes a non-emptyexamplesarray withparamsandresult.No runtime behavior, RPC semantics, method inventory, or versioning changes are included.
🗹 TODO before merging
📌 Submission Checklist
🧪 Testing Evidence
Please describe any additional testing aside from CI:
Additional validation performed locally:
cargo fmt --check -p midnight-nodepython3 -m json.tool docs/openrpc.json >/tmp/openrpc.validgit diff --check -- docs/openrpc.json node/src/openrpc.rsAdditionally verified:
Local environment limitation:
cargo test -p midnight-node --lib openrpc::testscould not complete becauseprotocwas unavailablenix develop . -c cargo test -p midnight-node --lib openrpc::testsgot pastprotocbut failed in themidnight-node-runtimebuild script becauselibstdc++.so.6was not available in the dynamic linker path🔱 Fork Strategy
Links