fabian-hiller / valibot

The modular and type safe schema library for validating structural data 🤖
https://valibot.dev
MIT License
6.33k stars 204 forks source link

add `requiredAsync` & `SchemaWithRequiredAsync` API refs #819

Closed EltonLobo07 closed 2 months ago

EltonLobo07 commented 2 months ago

The requiredAsync reference with this PR is a bit different from the required reference on the website. After this PR is merged, I'll make sure to update the required reference (if there are any changes needed). Here are the differences along with the reasons:

  1. The required reference does not use a type parameter for the message parameter but the requiredAsync reference does. I think we should list TMessage so that: a. the reference is as close to the code as possible. b. we display the link between the message parameter and the output schema in the reference.

  2. The naming of the output schemas. Instead of naming the output Schema, it is better to name the schemas AllKeysSchema and SelectedKeysSchema so that readers can identify the schemas in the 'Returns' section.

pkg-pr-new[bot] commented 2 months ago

Open in Stackblitz

pnpm add https://pkg.pr.new/valibot@819

commit: aae0579

fabian-hiller commented 2 months ago

You are right. The required API reference is not fully updated. Feel free to fix it.