Skip to content

Remove the JSON-RPC from the example's code in the documentation#288

Merged
vladimir-rangelov merged 3 commits intonext-bidirectionalfrom
feat/remove-the-JSON-RPC-from-the-examples-code
Jan 23, 2026
Merged

Remove the JSON-RPC from the example's code in the documentation#288
vladimir-rangelov merged 3 commits intonext-bidirectionalfrom
feat/remove-the-JSON-RPC-from-the-examples-code

Conversation

@vladimir-rangelov
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 23, 2026 08:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the documentation/example generation so that JSON-RPC example code is no longer emitted in generated docs, and adjusts demo OpenRPC definitions and a manual test script to align with the new behavior.

Changes:

  • In insertExampleMacros, skip JSON-RPC entries when iterating example languages so JSON-RPC example code is omitted from generated documentation.
  • Update demo_sdk/openrpc/simple.json to introduce a testMethodWithoutParams method, adjust example payloads and result schemas for a few methods, and refine examples used by docs generation.
  • Simplify demo_sdk/test/component/manualTest.mjs to run a single EventExtension.onBasicEvent subscription scenario and comment out the more complex manual scenarios.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/macrofier/engine.mjs Omits JSON-RPC language blocks when rendering method examples in templates while preserving other language handling.
demo_sdk/test/component/manualTest.mjs Switches the manual test to a basic onBasicEvent example and comments out the more complex event/property manual flows.
demo_sdk/openrpc/simple.json Adjusts demo OpenRPC methods, including adding a no-params method, updating result schemas and examples, and reordering/expanding example data used for docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

let languages = ''
Object.entries(example.languages).forEach(([name, language]) => {

//In the generated documentation, the example code for JSON-RPC is deprecated, so we omit it.
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

This inline comment is missing a space after the //, which is inconsistent with the surrounding comment style in this file (e.g., line 1954 uses // ...). For consistency with existing comments, please add a space after //.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 23, 2026 08:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +119 to +120
"summary": "A method that pulls its description from an external markdown file.",
"description": {
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The summary text "A method that pulls it's description from an external markdown file." uses "it's" (contraction of "it is") instead of the possessive "its". Please update this to use the correct possessive form to avoid a grammatical error in the generated documentation.

Copilot uses AI. Check for mistakes.
Comment on lines 1963 to +1969
Object.entries(example.languages).forEach(([name, language]) => {

//In the generated documentation, the example code for JSON-RPC is deprecated, so we omit it.
if (name.toLowerCase() === 'json-rpc') {
return;
}

Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

Filtering out the json-rpc language here means that any example whose languages object only contains JSON-RPC (e.g., RPC-only methods after isRPCOnlyMethod pruning) will still generate an example title but with an empty body in the rendered documentation because languages stays empty. If the goal is to remove JSON-RPC examples from the docs entirely, consider also skipping creation of the example block when all languages are filtered out, so the generated docs do not show an empty example section.

Copilot uses AI. Check for mistakes.
@vladimir-rangelov vladimir-rangelov merged commit c617d7c into next-bidirectional Jan 23, 2026
1 of 2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@vladimir-rangelov vladimir-rangelov deleted the feat/remove-the-JSON-RPC-from-the-examples-code branch January 23, 2026 09:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants