Skip to content

Adds support for maybeSchemaValue config - #482

Closed
Ustice wants to merge 9 commits into
Code-Hex:mainfrom
Ustice:issue-308
Closed

Ustice wants to merge 9 commits into
Code-Hex:mainfrom
Ustice:issue-308

Conversation

@Ustice

@Ustice Ustice commented Sep 21, 2023

Copy link
Copy Markdown

Adds support for maybeSchemaValue. This adds compatibility with changes to the inputMaybeValue configuration option.

resolves #308

Ustice and others added 9 commits September 21, 2023 13:13
@AaronMBMorse

Copy link
Copy Markdown

Is there anything holding back the merge? Would be great to have this in place.

@almereyda

almereyda commented Nov 26, 2023

Copy link
Copy Markdown

Your PR is acting different than I had expected from the documentation in #308 (comment)

What it does is, that it literally replaces the string nullish with whichever string is defined as maybeSchemaValue. The notation of the configuration example is also invalid YAML, and therefore a little inviting for misunderstandings.

Providing undefined will unfortunately not cast .optional(), but just .undefined().

Similarily writing nullish().undefined will cast .nullish().undefined().

I would like to set: mybeSchemaValue: null and have it remove everything behind the inferred Maybe type, removing the Maybe altogether. But that may be harsh.

Would it be possible to provide little examples with this new feature, and also to document it before merge?

@Code-Hex

Copy link
Copy Markdown
Owner

This PR is closed as it appears to be suspended. If you have any questions, I would appreciate it if you could submit the PR again!

@Code-Hex Code-Hex closed this Jun 15, 2024
@sbalay

sbalay commented Oct 14, 2024

Copy link
Copy Markdown

@Code-Hex would you be open to re reviewing this work and merging the new feature if I pick it up?

The work done here seems to be in a mergeable state, do you have any feedback?

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.

Allow configuration of zod optional/null type

5 participants