Skip to content

Conversation

geuben
Copy link
Contributor

@geuben geuben commented Aug 13, 2025

A default of null was being coerced into "null".

when the model is nullable, keep it as a null

'"const x = z.coerce.number().nullable().default(null)"',
)

await expect(execute(undefined)).resolves.toBeNull
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await expect(execute(undefined)).resolves.toBeNull
await expect(execute(undefined)).resolves.toBeNull()

(same for all the toBeNull assertions)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(surprised that linting didn't catch this tbh - will look into that separately)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

@mnahkies mnahkies merged commit 6a4b1ad into mnahkies:main Aug 13, 2025
3 checks passed
mnahkies added a commit that referenced this pull request Aug 13, 2025
apply fix/tests from #360
to the joi schema builder
mnahkies added a commit that referenced this pull request Aug 13, 2025
apply fix/tests from
#360 to the joi
schema builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants