From ce264112f2c148f266ca4b5ad2fe2d00896c970f Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Mon, 31 May 2021 18:30:15 +0300 Subject: [PATCH] fix: dropdown if type is array --- src/components/Schema/Schema.tsx | 4 ++++ src/services/models/Schema.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Schema/Schema.tsx b/src/components/Schema/Schema.tsx index ef774004..8948e2b4 100644 --- a/src/components/Schema/Schema.tsx +++ b/src/components/Schema/Schema.tsx @@ -63,6 +63,10 @@ export class Schema extends React.Component> { return ; } + if (type && Array.isArray(type)) { + return ; + } + switch (type) { case 'object': if (schema.fields?.length) { diff --git a/src/services/models/Schema.ts b/src/services/models/Schema.ts index 2de8740a..1f329285 100644 --- a/src/services/models/Schema.ts +++ b/src/services/models/Schema.ts @@ -166,7 +166,7 @@ export class SchemaModel { if (this.type === 'object') { this.fields = buildFields(parser, schema, this.pointer, this.options); - } else if (this.type === 'array' && schema.items) { + } else if ((this.type === 'array' || Array.isArray(this.type)) && schema.items) { this.items = new SchemaModel(parser, schema.items, this.pointer + '/items', this.options); this.displayType = pluralizeType(this.items.displayType); this.displayFormat = this.items.format;