chore: change the validation lookup

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2023-02-23 12:13:41 +01:00
parent 1bbd6dfe67
commit b239c818ff
@@ -42,7 +42,6 @@ import {
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
import { UserEntity } from '@backstage/catalog-model';
import { createCounterMetric, createHistogramMetric } from '../../util/metrics';
import { z } from 'zod';
type NunjucksWorkflowRunnerOptions = {
workingDirectory: string;
@@ -288,8 +287,9 @@ export class NunjucksWorkflowRunner implements WorkflowRunner {
{};
if (action.schema?.input) {
// Check to see if the input is a zod schema without using instanceof.
const inputSchema =
action.schema.input instanceof z.ZodSchema
'safeParseAsync' in action.schema.input
? zodToJsonSchema(action.schema.input)
: action.schema.input;