diff --git a/src/mapping.ts b/src/mapping.ts index 367c5e4b..d3ff16a2 100644 --- a/src/mapping.ts +++ b/src/mapping.ts @@ -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 // 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') { return readTypeTags(typeof decl.defaultValue, path, topTypeName, getCommentTags(decl, path, topTypeName, inheritedTags)); diff --git a/test/mapping-model/mappings/src/type-alias.ts b/test/mapping-model/mappings/src/type-alias.ts index b7fb4842..c19d5ce7 100644 --- a/test/mapping-model/mappings/src/type-alias.ts +++ b/test/mapping-model/mappings/src/type-alias.ts @@ -34,7 +34,7 @@ export interface TypeAlias { /** * @keyword */ - overriddenKeyword: ATextAlias + overriddenTextAsKeyword: ATextAlias type: ThingType.TypeAlias; } @@ -59,8 +59,8 @@ export const typeAliasTest: MapAggTestOptions = { keywordProperty: { type: ElasticsearchDataType.keyword, }, - overriddenKeyword: { - type: ElasticsearchDataType.text, + overriddenTextAsKeyword: { + type: ElasticsearchDataType.keyword, }, } }