fix: fix inherited properties not working correctly

This commit is contained in:
Wieland Schöbl
2021-07-05 17:57:10 +02:00
parent 99c698bd16
commit f20038c8f9
2 changed files with 6 additions and 4 deletions

View File

@@ -275,7 +275,9 @@ function handleDeclarationReflection(decl: DeclarationReflection,
} }
} else if (decl.type instanceof Type) { // if the object is a type, so we are dealing with a PROPERTY } else if (decl.type instanceof Type) { // if the object is a type, so we are dealing with a PROPERTY
// get inherited tags // get inherited tags
return handleType(decl.type, new Map(generics), path, topTypeName, getCommentTags(decl, path, topTypeName)); const tags = (inheritedTags ?? []).length > 0 ? inheritedTags! : getCommentTags(decl, path, topTypeName);
return handleType(decl.type, new Map(generics), path, topTypeName, tags);
} else if (decl.kindString === 'Enumeration member') { } else if (decl.kindString === 'Enumeration member') {
return readTypeTags(typeof decl.defaultValue, path, topTypeName, return readTypeTags(typeof decl.defaultValue, path, topTypeName,
getCommentTags(decl, path, topTypeName, inheritedTags)); getCommentTags(decl, path, topTypeName, inheritedTags));

View File

@@ -34,7 +34,7 @@ export interface TypeAlias {
/** /**
* @keyword * @keyword
*/ */
overriddenKeyword: ATextAlias overriddenTextAsKeyword: ATextAlias
type: ThingType.TypeAlias; type: ThingType.TypeAlias;
} }
@@ -59,8 +59,8 @@ export const typeAliasTest: MapAggTestOptions = {
keywordProperty: { keywordProperty: {
type: ElasticsearchDataType.keyword, type: ElasticsearchDataType.keyword,
}, },
overriddenKeyword: { overriddenTextAsKeyword: {
type: ElasticsearchDataType.text, type: ElasticsearchDataType.keyword,
}, },
} }
} }