From 113cf10543d275ac524ed5f8ba73a704ab44183d Mon Sep 17 00:00:00 2001 From: Samuel Date: Thu, 30 Jul 2020 02:41:47 +0200 Subject: [PATCH] fix(scalar): default 'type' to array when 'items' is defined on a schema --- src/core/getters/scalar.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/getters/scalar.ts b/src/core/getters/scalar.ts index 64cad722f..99aebcf07 100644 --- a/src/core/getters/scalar.ts +++ b/src/core/getters/scalar.ts @@ -12,6 +12,10 @@ import { getObject } from './object'; export const getScalar = (item: SchemaObject, name?: string): ResolverValue => { const nullable = item.nullable ? ' | null' : ''; + if (!item.type && item.items) { + item.type = 'array'; + } + switch (item.type) { case 'int32': case 'int64':