diff --git a/generator/konfig-dash/packages/konfig-lib/src/util/generate-and-merge-schema-objects.ts b/generator/konfig-dash/packages/konfig-lib/src/util/generate-and-merge-schema-objects.ts index 5f8b09aaa..dde11e663 100644 --- a/generator/konfig-dash/packages/konfig-lib/src/util/generate-and-merge-schema-objects.ts +++ b/generator/konfig-dash/packages/konfig-lib/src/util/generate-and-merge-schema-objects.ts @@ -12,13 +12,16 @@ export function generateAndMergeSchemaObjects({ }: { examples: Json[] version: OpenApiVersion -}) { +}): SchemaOrReference { const exampleSchemaObjects: SchemaOrReference[] = examples.map((example) => generateSchemaObjectFromJson({ json: example, version, }) ) + if (exampleSchemaObjects.length === 0) { + return {} + } const mergedSchemaObject = exampleSchemaObjects.reduce((a, b) => mergeSchemaObject({ a, b }) )