Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 51 additions & 20 deletions demo_sdk/openrpc/simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@
]
},
{
"name": "testMarkdownDescription",
"summary": "A method that pulls it's description from an external markdown file.",
"description": {
"$ref": "file:../descriptions/modules/Simple/methodWithMarkdownDescription.md"
},
"name": "testMethodWithoutParams",
"summary": "A method.",
"tags": [
{
"name": "capabilities",
Expand All @@ -81,16 +78,8 @@
]
}
],
"params": [
{
"name": "parameter",
"required": true,
"schema": {
"type": "boolean"
},
"summary": "A test parameter."
}
],
"description": "Validates basic method generation with no parameters and a simple object result.",
"params": [],
"result": {
"name": "result",
"summary": "A result for testing basic method generation.",
Expand All @@ -112,6 +101,50 @@
"additionalProperties": false
}
},
"examples": [
{
"name": "Default Example",
"params": [],
"result": {
"name": "Default Result",
"value": {
"foo": "here's foo"
}
}
}
]
},
{
"name": "testMarkdownDescription",
"summary": "A method that pulls its description from an external markdown file.",
"description": {
Comment on lines +119 to +120
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.
"$ref": "file:../descriptions/modules/Simple/methodWithMarkdownDescription.md"
},
"tags": [
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:test:test"
]
}
],
"params": [
{
"name": "parameter",
"required": true,
"schema": {
"type": "boolean"
},
"summary": "A test parameter."
}
],
"result": {
"name": "result",
"summary": "A result string.",
"schema": {
"type": "string"
}
},
"examples": [
{
"name": "Default Example",
Expand All @@ -123,9 +156,7 @@
],
"result": {
"name": "Default Result",
"value": {
"foo": "here's foo"
}
"value": "here's the result"
}
}
]
Expand Down Expand Up @@ -213,7 +244,7 @@
"name": "result",
"summary": "A result for testing basic method generation.",
"schema": {
"type": "null"
"type": "integer"
}
},
"examples": [
Expand All @@ -227,7 +258,7 @@
],
"result": {
"name": "Default Result",
"value": null
"value": 123
}
}
]
Expand Down
36 changes: 26 additions & 10 deletions demo_sdk/test/component/manualTest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,36 @@ import { triggerRaw } from './utils/httpClientHelper.js';

let result = null;

result = await new Promise((resolve) => {
let listenerId = null;

EventExtension.once("onBasicEvent", (data) => {
console.log("Subscribe callback:", data);
EventExtension.clear(listenerId);
resolve(data);
}).then((id) => {
listenerId = id;
console.log("Subscribe ID:", listenerId);
triggerRaw('{"jsonrpc":"2.0","method":"EventExtension.onBasicEvent","params":{ "value": "foo param"}}');
});
});

console.log("Final Result:", result);

/*
result = await new Promise((resolve) => {
let listenerId = null;

EventExtension.once("onEventWithThreeParams", (param1, param2, param3) => {
console.log("Subscribe callback:", param1, param2, param3);
EventExtension.once("onEventWithThreeParams", (param1, param2, param3) => {
console.log("Subscribe callback:", param1, param2, param3);

EventExtension.clear(listenerId);
resolve({ param1, param2, param3 });
}).then((id) => {
listenerId = id;
console.log("Subscribe ID:", listenerId);
triggerRaw('{"jsonrpc":"2.0","method":"EventExtension.onEventWithThreeParams","params":{"appId": "someAppId", "value": "foo param", "extra": {"foo":"bar"}}}');
});
EventExtension.clear(listenerId);
resolve({ param1, param2, param3 });
}).then((id) => {
listenerId = id;
console.log("Subscribe ID:", listenerId);
triggerRaw('{"jsonrpc":"2.0","method":"EventExtension.onEventWithThreeParams","params":{"appId": "someAppId", "value": "foo param", "extra": {"foo":"bar"}}}');
});
});

console.log("Final Result:", result);
Expand All @@ -43,4 +59,4 @@ result = await new Promise((resolve) => {

console.log("Final Result:", result);


*/
6 changes: 6 additions & 0 deletions src/macrofier/engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,12 @@ function insertExampleMacros(template, examples, method, json, templates, appApi
let first = true
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.
if (name.toLowerCase() === 'json-rpc') {
return;
}

Comment on lines 1963 to +1969
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.
let languageContent = language.template //getTemplateForExample(method, templates)
// wrap example in collapsible HTML if not first
if (!first) {
Expand Down
Loading