File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ export class JsonRpcApiOperation implements ApiOperation {
168168
169169}
170170
171+ const capitalizeFirst = ( input : string | undefined ) =>
172+ input
173+ ? input . charAt ( 0 ) . toUpperCase ( ) + input . slice ( 1 )
174+ : undefined ;
175+
171176export class JsonRpcApiRequest implements ApiRequest {
172177
173178 constructor ( rpcMethod : MatchedOperation , exchange : HttpExchange ) {
@@ -182,7 +187,18 @@ export class JsonRpcApiRequest implements ApiRequest {
182187 description : fromMarkdown ( [
183188 param . summary ,
184189 param . description ,
185- schema ?. title
190+ capitalizeFirst ( schema ?. title ) ,
191+ ...( schema ?. oneOf ?. length
192+ ? [
193+ 'One of:' ,
194+ ( schema . oneOf as JSONSchemaObject [ ] ) . map ( subschema =>
195+ `* ${ capitalizeFirst ( subschema . title ) } : ${
196+ subschema . description || subschema . type || 'unknown'
197+ } `
198+ ) . join ( '\n' )
199+ ]
200+ : [ ]
201+ )
186202 ] . filter ( x => ! ! x ) . join ( '\n\n' ) ) ,
187203 in : 'body' ,
188204 required : ! ! param . required ,
You can’t perform that action at this time.
0 commit comments