diff --git a/apps/reference/generator/legacy.ts b/apps/reference/generator/legacy.ts index ad745cd5f5b..a432608294f 100644 --- a/apps/reference/generator/legacy.ts +++ b/apps/reference/generator/legacy.ts @@ -130,8 +130,14 @@ function recurseThroughParams(paramDefinition: TsDoc.TypeDefinition) { if (param.type?.declaration?.children) { children = param.type?.declaration?.children } else if (isUnion(param)) { - // children = param.type.types - children = null // We don't want to show the union types + // We don't want to show the union types if it's a literal + const nonLiteralVariants = param.type.types.filter(({ type }) => type !== 'literal') + + if (nonLiteralVariants.length === 0) { + children = null + } else { + children = nonLiteralVariants + } } else if (param.type === 'reflection') { children = param.declaration.children }