Skip to content

Commit

Permalink
Nullable enums in server modules and objects
Browse files Browse the repository at this point in the history
  • Loading branch information
kaihaase committed Dec 14, 2023
1 parent 623827d commit 1cd6a0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lenne.tech/cli",
"version": "0.0.97",
"version": "0.0.98",
"description": "lenne.Tech CLI: lt",
"keywords": [
"lenne.Tech",
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class Server {
reference
? (isArray ? '[' : '') + `{ type: Schema.Types.ObjectId, ref: '${reference}' }` + (isArray ? ']' : '')
: enumRef
? (isArray ? '[' : '') + `{ type: String, enum: ${enumRef} }` + (isArray ? ']' : '')
? (isArray ? '[' : '') + `{ type: String, enum: ${item.nullable ? `Object.values(${enumRef}).concat([null])` : enumRef} }` + (isArray ? ']' : '')
: ''
})
${propName}: ${
Expand Down

0 comments on commit 1cd6a0b

Please sign in to comment.