From 6282b6d9a1c5cc07b3102f88f6c642af2f1ada7b Mon Sep 17 00:00:00 2001 From: Caroline Illemann Hansen Date: Thu, 29 Aug 2024 12:59:13 +0200 Subject: [PATCH] fix: make asset properties required nullable --- src/genericTypes.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/genericTypes.ts b/src/genericTypes.ts index 7152943..0ab089b 100644 --- a/src/genericTypes.ts +++ b/src/genericTypes.ts @@ -33,40 +33,40 @@ async function generateAssetTypeIfNotYetGenerated(title: string, compilerOptions '$id': '#/asset', title: title, type: 'object', - required: ['id', 'filename', 'name'], + required: ['id', 'alt', 'name', 'focus', 'source', 'title', 'filename', 'copyright'], properties: { _uid: { type: 'string' }, id: { - type: 'number' + type: ['number', 'null'], }, alt: { - type: 'string' + type: ['string', 'null'] }, name: { type: 'string' }, focus: { - type: 'string' + type: ['string', 'null'] }, source: { - type: 'string' + type: ['string', 'null'] }, title: { - type: 'string' + type: ['string', 'null'] }, filename: { type: 'string' }, copyright: { - type: 'string' + type: ['string', 'null'] }, fieldtype: { type: 'string' }, meta_data: { - type: ["null", "object"] + type: ['null', 'object'] }, is_external_url: { type: 'boolean' @@ -454,6 +454,3 @@ async function generateTableTypeIfNotYetGenerated(title: string, compilerOptions console.log('ERROR', e) } } - - -