Skip to content

Commit

Permalink
Merge pull request activepieces#5355 from activepieces/fix-open-api
Browse files Browse the repository at this point in the history
fix: type.null() issue with swagger in user invitation
  • Loading branch information
abuaboud authored Aug 14, 2024
2 parents 1d85c65 + 694de19 commit 4aca3ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/shared/src/lib/common/base-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export const Nullable = <T extends TSchema>(schema: T) => Type.Optional(Type.Uns
...schema, nullable: true,
}))

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function NullableEnum<T extends TEnum<any>>(schema: T) {
const values = schema.anyOf.map(f => f.const);
const values = schema.anyOf.map(f => f.const)
return Type.Optional(Type.Unsafe<Static<T> | null>({ type: 'string', enum: values, nullable: true }))
}

0 comments on commit 4aca3ad

Please sign in to comment.