From 1ad4eb3a7bcda2fb202f3a0cb723929d124d821f Mon Sep 17 00:00:00 2001 From: user1 Date: Fri, 26 May 2023 11:52:23 -0700 Subject: [PATCH] Progress toward improvement in fieldTemplateBuilder.ts getFieldType() --- .../nodes/util/fieldTemplateBuilders.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts b/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts index 28a9c8ec7c..e1f65e8826 100644 --- a/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts +++ b/invokeai/frontend/web/src/features/nodes/util/fieldTemplateBuilders.ts @@ -302,9 +302,20 @@ export const getFieldType = ( if (typeHints && name in typeHints) { rawFieldType = typeHints[name]; } else if (!schemaObject.type) { - rawFieldType = refObjectToFieldType( - schemaObject.allOf![0] as OpenAPIV3.ReferenceObject - ); + // if schemaObject has no type, then it should have one of allOf, anyOf, oneOf + if (schemaObject.allOf) { + rawFieldType = refObjectToFieldType( + schemaObject.allOf![0] as OpenAPIV3.ReferenceObject + ); + } else if (schemaObject.anyOf) { + rawFieldType = refObjectToFieldType( + schemaObject.anyOf![0] as OpenAPIV3.ReferenceObject + ); + } else if (schemaObject.oneOf) { + rawFieldType = refObjectToFieldType( + schemaObject.oneOf![0] as OpenAPIV3.ReferenceObject + ); + } } else if (schemaObject.enum) { rawFieldType = 'enum'; } else if (schemaObject.type) {