docs-util: fix hook parameters not showing when using workflow input (#12382)
This commit is contained in:
1 parent
80007f3afd
commit
91173f3052
1 file changed
+10
-2
@@ -22,6 +22,7 @@ import {
|
||||
addTagsToReflection,
|
||||
getResolvedResourcesOfStep,
|
||||
getUniqueStrArray,
|
||||
getWorkflowInputType,
|
||||
} from "utils"
|
||||
import { StepType } from "./types.js"
|
||||
import Examples from "./utils/examples.js"
|
||||
@@ -565,9 +566,15 @@ class WorkflowsPlugin {
|
||||
ReflectionKind.Parameter,
|
||||
signatureReflection
|
||||
)
|
||||
const isParameterWorkflowInput =
|
||||
inputSymbol.valueDeclaration?.kind === ts.SyntaxKind.Parameter &&
|
||||
workflowReflection.signatures?.length
|
||||
parameter.type = isParameterWorkflowInput
|
||||
? getWorkflowInputType(workflowReflection.signatures![0]) ||
|
||||
ReferenceType.createSymbolReference(inputSymbol, context)
|
||||
: ReferenceType.createSymbolReference(inputSymbol, context)
|
||||
|
||||
parameter.type = ReferenceType.createSymbolReference(inputSymbol, context)
|
||||
|
||||
if (parameter.type.type === "reference") {
|
||||
if (parameter.type.name === "__object") {
|
||||
parameter.type.name = "object"
|
||||
parameter.type.qualifiedName = "object"
|
||||
@@ -599,6 +606,7 @@ class WorkflowsPlugin {
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signatureReflection.parameters = []
|
||||
|
||||
|
||||
Reference in new issue
Block a user