From ca6642d1b7d69f1f78d1d002f35ab149e66f6d46 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 30 Jan 2023 11:48:20 -0500 Subject: [PATCH] test: support for anyOf and oneOf --- test/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/api.js b/test/api.js index 0cf3a76685..ad0b6a5bee 100644 --- a/test/api.js +++ b/test/api.js @@ -553,10 +553,10 @@ describe('API', async () => { if (schema[prop].items) { // Ensure the array items have a schema defined - assert(schema[prop].items.type || schema[prop].items.allOf, `"${prop}" is defined to be an array, but its items have no schema defined (path: ${method} ${path}, context: ${context})`); + assert(schema[prop].items.type || schema[prop].items.allOf || schema[prop].items.anyOf || schema[prop].items.oneOf, `"${prop}" is defined to be an array, but its items have no schema defined (path: ${method} ${path}, context: ${context})`); // Compare types - if (schema[prop].items.type === 'object' || Array.isArray(schema[prop].items.allOf)) { + if (schema[prop].items.type === 'object' || Array.isArray(schema[prop].items.allOf || schema[prop].items.anyOf || schema[prop].items.oneOf)) { response[prop].forEach((res) => { compare(schema[prop].items, res, method, path, context ? [context, prop].join('.') : prop); });