Skip to content
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

docs(api): Optional related documentation #321

Merged
merged 5 commits into from
Dec 26, 2023

Conversation

sqmasep
Copy link
Contributor

@sqmasep sqmasep commented Dec 25, 2023

Hi!

I wrote the documentation of optional() with examples, and since i was confused at first with fallback() at first, i decided to write the difference between the two, so people won't make the same misconception as me previously. I also included the difference with nullish() and nullable() since it's quite similar but with minor differences. Feel free to tell me if anything is wrong or how i can improve it.

WARN: see api/(types)/OptionalSchema

I created a new folder in src called data, see the purpose of this below

Added:

  • src/data/allSchemas.ts: an array of strings with all the schemas inside. (['any', 'array', 'bigint', ...])
  • api/(types)/OptionalSchema: OptionalSchema type definition (WARN: i couldn't represent some types, i added two "WARN" comments inside of the file in the export const properties

Edited:

  • api/(schemas)/optional: optional() explanation, usage & examples
  • api/menu.md: Added OptionalSchema in the types section

Copy link

netlify bot commented Dec 25, 2023

‼️ Deploy request for valibot rejected.

Name Link
🔨 Latest commit 59b7826

@fabian-hiller fabian-hiller self-assigned this Dec 25, 2023
@fabian-hiller fabian-hiller added the documentation Improvements or additions to documentation label Dec 25, 2023
@fabian-hiller
Copy link
Owner

Thank you very much. I will review and improve it and if necessary give you feedback.

@fabian-hiller
Copy link
Owner

Thank you very much for your contribution! I am sorry that I deleted some of your detailed examples. For now, I want to keep the API reference simple. I see value in what you have done and will try to combine this with a playground section in the future where you can experiment with each schema in an embedded editor. Feel free to create an issue for that.

Feel free to copy the final API reference to add the reference for nullable and nullish. Please reach out if you have questions. You can also write me on Discord (fabianhiller).

@fabian-hiller fabian-hiller merged commit dffd857 into fabian-hiller:main Dec 26, 2023
1 check passed
@sqmasep
Copy link
Contributor Author

sqmasep commented Dec 26, 2023

That's perfectly fine! I only start to contribute to open source projects so I'm not used to that yet, I'm starting to see your vision on the docs and how it should be, I'll try to adapt more for the next PRs 😉, thank you for the feedback, I'll take that into consideration

@sqmasep sqmasep deleted the docs/optional branch December 26, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants