fix: use value type in IndexSignature type instead of key type

This commit is contained in:
Wieland Schöbl
2020-01-28 13:02:31 +01:00
committed by wulkanat@gmail.com
parent 681cef9260
commit b7cdb6a9ad
2 changed files with 4 additions and 34209 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -117,7 +117,6 @@ function composeErrorMessage(path: string, topTypeName: string, typeName: string
* @param type the ReferenceType of a DeclarationReflection
* @param out the previous reflection, it then overrides all parameters or keeps old ones
* @param path the current path to the object we are in
* @param topTypeName the type field value
* @param tags any tags attached to the type
*/
function getReflectionGeneric(type: ReferenceType,
@@ -211,7 +210,7 @@ function handleDeclarationReflection(decl: DeclarationReflection,
// check if we have an object referencing a generic
if (generics.has(decl.name)) { // if the object name is the same as the generic name
return readFieldTags(generics.get(decl.name) as ElasticsearchObject | ElasticsearchType, path, topTypeName,
typeof decl.comment !== 'undefined' ? typeof decl.comment.tags !== 'undefined' ? decl.comment.tags : [] : []);
decl.comment?.tags ?? []);
// use the value defined by the generic
}
@@ -232,9 +231,9 @@ function handleDeclarationReflection(decl: DeclarationReflection,
const template: ElasticsearchDynamicTemplate = {};
template[decl.name] = {
mapping: handleType(
decl.indexSignature.type,
new Map(generics), path, topTypeName,
getCommentTags(decl.indexSignature)),
decl.indexSignature.type,
new Map(generics), path, topTypeName,
getCommentTags(decl.indexSignature)),
match: '*',
match_mapping_type: '*',
path_match: `${path}*`,