-
-
Couldn't load subscription status.
- Fork 281
docs: clarify pipe behavior for missing keys in optional schemas #1304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Perdolique
commented
Sep 11, 2025
- Add important notes about pipe execution for missing keys
- Explain that default values are required for pipe execution
- Improve clarity across optional, exactOptional, and guides
- Enhance understanding of transformation behavior
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR clarifies the behavior of pipe execution when using optional schemas (optional and exactOptional) with missing object keys. The documentation explains that pipe actions only execute when default values are provided or keys are present.
- Added comprehensive documentation about pipe execution behavior for missing keys
- Enhanced API documentation for
optionalandexactOptionalschemas with pipe examples - Improved clarity around when transformations and other pipe actions execute
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| website/src/routes/guides/(schemas)/optionals/index.mdx | Added new section explaining pipe execution behavior with and without default values |
| website/src/routes/api/(schemas)/optional/index.mdx | Added important note and examples showing pipe behavior for missing keys |
| website/src/routes/api/(schemas)/exactOptional/index.mdx | Added similar important note and pipe examples for exact optional schemas |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| With `exactOptional` the validation of your schema will pass missing object entries, and if you specify a `default_` input value, the schema will use it if the object entry is missing. For this reason, the output type may differ from the input type of the schema. | ||
|
|
||
| > **Important**: When a key is missing and no `default_` value is provided, the schema's pipe (including transformations) will not be executed. To ensure pipes run for missing keys, provide a `default_` value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should mention that this is only the cases when using this schema with an object schema. If think this is not clear enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabian-hiller, added a couple of words about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I will take a closer look an merge this PR in the next days.
- Add important notes about pipe execution for missing keys - Explain that default values are required for pipe execution - Improve clarity across optional, exactOptional, and guides - Enhance understanding of transformation behavior
|
I haven't forgotten you and will probably merge this PR in 1 to 2 weeks. I am currently focused on Formisch a few other things. |