diff --git a/src/index.ts b/src/index.ts index dc5750b..a844289 100644 --- a/src/index.ts +++ b/src/index.ts @@ -131,7 +131,10 @@ async function generateModel(collection: Collection, schema: SchemaOverview, ser if (fieldItem?.options?.choices?.length) { // this is an enum with fixed choices! type = fieldItem?.options?.choices - ?.map(choice => `'${choice.value.replaceAll('\'', '\\\'')}'`) + ?.map(choice => typeof choice.value === 'string' ? + `'${choice.value.replaceAll('\'', '\\\'')}'` + : choice.value + ) ?.join(' | '); // add array type in case of multi-selection