@@ -27,7 +27,7 @@ export const generatePropertySignatures = (
2727 return factory . PropertySignature . create ( {
2828 name : convertContext . escapePropertySignatureName ( propertyName ) ,
2929 optional : ! required . includes ( propertyName ) ,
30- comment : schema . description ,
30+ comment : [ schema . title , schema . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) ,
3131 type : factory . TypeNode . create ( {
3232 type : "any" ,
3333 } ) ,
@@ -37,7 +37,7 @@ export const generatePropertySignatures = (
3737 name : convertContext . escapePropertySignatureName ( propertyName ) ,
3838 optional : ! required . includes ( propertyName ) ,
3939 type : ToTypeNode . convert ( entryPoint , currentPoint , factory , property , context , convertContext , { parent : schema } ) ,
40- comment : typeof property !== "boolean" ? property . description : undefined ,
40+ comment : typeof property !== "boolean" ? [ property . title , property . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) : undefined ,
4141 } ) ;
4242 } ) ;
4343} ;
@@ -86,7 +86,7 @@ export const generateArrayTypeAlias = (
8686 return factory . TypeAliasDeclaration . create ( {
8787 export : true ,
8888 name : convertContext . escapeDeclarationText ( name ) ,
89- comment : schema . description ,
89+ comment : [ schema . title , schema . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) ,
9090 type : ToTypeNode . convert ( entryPoint , currentPoint , factory , schema , context , convertContext ) ,
9191 } ) ;
9292} ;
@@ -119,7 +119,7 @@ export const generateNotInferedTypeAlias = (
119119 export : true ,
120120 name : convertContext . escapeDeclarationText ( name ) ,
121121 type : typeNode ,
122- comment : schema . description ,
122+ comment : [ schema . title , schema . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) ,
123123 } ) ;
124124} ;
125125
@@ -159,11 +159,12 @@ export const generateTypeAlias = (
159159 type : schema . type ,
160160 } ) ;
161161 }
162+
162163 return factory . TypeAliasDeclaration . create ( {
163164 export : true ,
164165 name : convertContext . escapeDeclarationText ( name ) ,
165166 type,
166- comment : schema . description ,
167+ comment : [ schema . title , schema . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) ,
167168 } ) ;
168169} ;
169170
0 commit comments