@@ -27,7 +27,7 @@ export const generatePropertySignatures = (
27
27
return factory . PropertySignature . create ( {
28
28
name : convertContext . escapePropertySignatureName ( propertyName ) ,
29
29
optional : ! required . includes ( propertyName ) ,
30
- comment : schema . description ,
30
+ comment : [ schema . title , schema . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) ,
31
31
type : factory . TypeNode . create ( {
32
32
type : "any" ,
33
33
} ) ,
@@ -37,7 +37,7 @@ export const generatePropertySignatures = (
37
37
name : convertContext . escapePropertySignatureName ( propertyName ) ,
38
38
optional : ! required . includes ( propertyName ) ,
39
39
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 ,
41
41
} ) ;
42
42
} ) ;
43
43
} ;
@@ -86,7 +86,7 @@ export const generateArrayTypeAlias = (
86
86
return factory . TypeAliasDeclaration . create ( {
87
87
export : true ,
88
88
name : convertContext . escapeDeclarationText ( name ) ,
89
- comment : schema . description ,
89
+ comment : [ schema . title , schema . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) ,
90
90
type : ToTypeNode . convert ( entryPoint , currentPoint , factory , schema , context , convertContext ) ,
91
91
} ) ;
92
92
} ;
@@ -119,7 +119,7 @@ export const generateNotInferedTypeAlias = (
119
119
export : true ,
120
120
name : convertContext . escapeDeclarationText ( name ) ,
121
121
type : typeNode ,
122
- comment : schema . description ,
122
+ comment : [ schema . title , schema . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) ,
123
123
} ) ;
124
124
} ;
125
125
@@ -159,11 +159,12 @@ export const generateTypeAlias = (
159
159
type : schema . type ,
160
160
} ) ;
161
161
}
162
+
162
163
return factory . TypeAliasDeclaration . create ( {
163
164
export : true ,
164
165
name : convertContext . escapeDeclarationText ( name ) ,
165
166
type,
166
- comment : schema . description ,
167
+ comment : [ schema . title , schema . description ] . filter ( v => ! ! v ) . join ( "\n\n" ) ,
167
168
} ) ;
168
169
} ;
169
170
0 commit comments