@@ -148,6 +148,7 @@ export class TypeResolver {
148148 type,
149149 validators : getPropertyValidators ( propertySignature ) || { } ,
150150 deprecated : isExistJSDocTag ( propertySignature , tag => tag . tagName . text === 'deprecated' ) ,
151+ title : this . getNodeTitle ( propertySignature ) ,
151152 extensions : this . getNodeExtension ( propertySignature ) ,
152153 } ;
153154
@@ -905,6 +906,7 @@ export class TypeResolver {
905906 const example = this . getNodeExample ( modelType ) ;
906907 const description = this . getNodeDescription ( modelType ) ;
907908 const deprecated = isExistJSDocTag ( modelType , tag => tag . tagName . text === 'deprecated' ) || isDecorator ( modelType , identifier => identifier . text === 'Deprecated' ) ;
909+ const title = this . getNodeTitle ( modelType ) ;
908910
909911 // Handle toJSON methods
910912 throwUnless ( modelType . name , new GenerateMetadataError ( "Can't get Symbol from anonymous class" , modelType ) ) ;
@@ -927,6 +929,7 @@ export class TypeResolver {
927929 validators : { } ,
928930 deprecated,
929931 ...( example && { example } ) ,
932+ ...( title && { title } ) ,
930933 } ;
931934 return referenceType ;
932935 }
@@ -943,6 +946,7 @@ export class TypeResolver {
943946 refName : refTypeName ,
944947 deprecated,
945948 ...( example && { example } ) ,
949+ ...( title && { title } ) ,
946950 } ;
947951
948952 referenceType . properties = referenceType . properties . concat ( properties ) ;
@@ -1194,6 +1198,10 @@ export class TypeResolver {
11941198 return getJSDocComment ( node , 'format' ) ;
11951199 }
11961200
1201+ public getNodeTitle ( node : ts . Node ) {
1202+ return getJSDocComment ( node , 'title' ) ;
1203+ }
1204+
11971205 public getPropertyName ( prop : ts . PropertySignature | ts . PropertyDeclaration | ts . ParameterDeclaration ) : string {
11981206 if ( ts . isComputedPropertyName ( prop . name ) && ts . isPropertyAccessExpression ( prop . name . expression ) ) {
11991207 const initializerValue = getInitializerValue ( prop . name . expression , this . current . typeChecker ) ;
0 commit comments