diff --git a/src/ApiTypeDocument.js b/src/ApiTypeDocument.js index 19acae4..ed70be0 100644 --- a/src/ApiTypeDocument.js +++ b/src/ApiTypeDocument.js @@ -502,17 +502,7 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) { [item] = item; } if (this._hasType(item, this.ns.aml.vocabularies.shapes.ArrayShape)) { - item = this._resolve(item); - const itemsKey = this._getAmfKey(this.ns.aml.vocabularies.shapes.items); - const items = this._ensureArray(item[itemsKey]); - if (items && items.length === 1) { - let result = items[0]; - if (Array.isArray(result)) { - [result] = result; - } - result = this._resolve(result); - return result; - } + return this._resolve(item); } if (Array.isArray(item)) { [item] = item; diff --git a/test/api-type-document.test.js b/test/api-type-document.test.js index b80a0d4..d41a651 100644 --- a/test/api-type-document.test.js +++ b/test/api-type-document.test.js @@ -341,7 +341,7 @@ describe('', () => { assert.isUndefined(result); }); - it('Computes union type for an array item', async () => { + it('Computes union type for an array', async () => { const [amf, type] = await AmfLoader.loadType('UnionArray', item[1]); element.amf = amf; key = element._getAmfKey(element.ns.aml.vocabularies.shapes.anyOf); @@ -349,7 +349,7 @@ describe('', () => { assert.isTrue( element._hasType( result, - element.ns.aml.vocabularies.shapes.ScalarShape + element.ns.aml.vocabularies.shapes.ArrayShape ) ); });