From e32dd6a9dfd39c4b82abc40cb88ea0cacb6cfa4d Mon Sep 17 00:00:00 2001 From: junjiequan Date: Mon, 9 Dec 2024 16:18:06 +0100 Subject: [PATCH] fix: update schema validation from oneOf to anyOf for dataset creation and updates --- src/datasets/datasets.controller.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/datasets/datasets.controller.ts b/src/datasets/datasets.controller.ts index 3cadf553c..bcee3bdb1 100644 --- a/src/datasets/datasets.controller.ts +++ b/src/datasets/datasets.controller.ts @@ -1,4 +1,3 @@ -/* eslint-disable @/quotes */ import { Body, Controller, @@ -567,7 +566,7 @@ export class DatasetsController { description: "Input fields for the dataset to be created", required: true, schema: { - oneOf: [ + anyOf: [ { $ref: getSchemaPath(CreateRawDatasetObsoleteDto) }, { $ref: getSchemaPath(CreateDerivedDatasetObsoleteDto) }, { $ref: getSchemaPath(CreateDatasetDto) }, @@ -731,7 +730,7 @@ export class DatasetsController { description: "Input fields for the dataset that needs to be validated", required: true, schema: { - oneOf: [ + anyOf: [ { $ref: getSchemaPath(CreateRawDatasetObsoleteDto) }, { $ref: getSchemaPath(CreateDerivedDatasetObsoleteDto) }, { $ref: getSchemaPath(CreateDatasetDto) }, @@ -1245,7 +1244,7 @@ export class DatasetsController { "Fields that needs to be updated in the dataset. Only the fields that needs to be updated have to be passed in.", required: true, schema: { - oneOf: [ + anyOf: [ { $ref: getSchemaPath(PartialUpdateRawDatasetObsoleteDto) }, { $ref: getSchemaPath(PartialUpdateDerivedDatasetObsoleteDto) }, { $ref: getSchemaPath(PartialUpdateDatasetDto) }, @@ -1357,7 +1356,7 @@ export class DatasetsController { "Dataset object that needs to be updated. The whole dataset object with updated fields have to be passed in.", required: true, schema: { - oneOf: [ + anyOf: [ { $ref: getSchemaPath(UpdateRawDatasetObsoleteDto) }, { $ref: getSchemaPath(UpdateDerivedDatasetObsoleteDto) }, { $ref: getSchemaPath(UpdateDatasetDto) },