@@ -3,12 +3,13 @@ import fs from "node:fs/promises";
33import path from "node:path" ;
44import Mustache from "mustache" ;
55import { Config } from "./Config" ;
6- import { getReturnType , getThrows , replaceModelTypes } from "./util.js" ;
6+ import { getReturnDescription , getReturnType , getThrows , replaceModelTypes } from "./util.js" ;
77import Package from "./Package" ;
88
99interface FlatOperation {
1010 name : string ;
1111 returnType : string ;
12+ returnDescription ?: string ;
1213 params : {
1314 path : string ;
1415 query : string ;
@@ -43,6 +44,7 @@ export default async (schema: Schema, config: Config, pkg: Package) => {
4344 const operations : FlatOperation [ ] = [ ] ;
4445 for ( const [ name , operation ] of input ) {
4546 const returnType = getReturnType ( operation , schema , config ) ;
47+ const returnDescription = getReturnDescription ( operation , schema , config ) ;
4648 const toFlatParam = ( [ name , parameter ] : [ string , Schema . Operation . Parameter ] ) : NamedParameter => {
4749 const ts = `${ name } ${ ! parameter . required && ! parameter . default ? "?: " : ": " } ${ parameter . type } ${ parameter . default ? ` = ${ parameter . default } ` : "" } ` ;
4850 return { name, ts, ...parameter } ;
@@ -68,6 +70,7 @@ export default async (schema: Schema, config: Config, pkg: Package) => {
6870 operations . push ( {
6971 name,
7072 returnType,
73+ returnDescription,
7174 params,
7275 allParams,
7376 tsArgs,
0 commit comments