From e6a99b9f07c8b4cf94352029a432bc6bbc84059b Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 28 Dec 2020 11:54:18 +0100 Subject: [PATCH] metadataMd section aliasses (#2992) --- packages/typegen/src/metadataMd.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/typegen/src/metadataMd.ts b/packages/typegen/src/metadataMd.ts index e5311443c3..9917084f35 100644 --- a/packages/typegen/src/metadataMd.ts +++ b/packages/typegen/src/metadataMd.ts @@ -112,8 +112,8 @@ function addRpc (): string { description: DESC_RPC, sections: sections .sort() - .map((sectionName) => { - const section = definitions[sectionName as 'babe']; + .map((_sectionName) => { + const section = definitions[_sectionName as 'babe']; return { // description: section.description, @@ -121,6 +121,7 @@ function addRpc (): string { .sort() .map((methodName) => { const method = section.rpc[methodName]; + const sectionName = method.aliasSection || _sectionName; const args = method.params.map(({ isOptional, name, type }: DefinitionRpcParam): string => { // eslint-disable-next-line @typescript-eslint/restrict-plus-operands return name + (isOptional ? '?' : '') + ': `' + type + '`'; @@ -134,7 +135,7 @@ function addRpc (): string { ...(method.description && { summary: method.description }) }; }), - name: sectionName + name: _sectionName }; }), title: 'JSON-RPC'