-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Hey everyone!
So many people have asked me about contributing and I always reply the same thing so I thought I'll take a bit of time to write up a bit of guidance if you want to try to contribute to the project.
Firstly awesome! You rock! thanks for taking the time!
If you are here I assume you are not sure how to get started or are looking for ideas for your first PR.
I suggest you start by creating a new builtin Test (what Zog calls validations). This is quite simple, here is how I would go about doing so:
- Go to https://zod.dev/ or https://github.com/go-playground/validator or some other validation library
- Find a validation that Zog doesn't have built in yet and you think we should have (it won't be hard since we are still missing a lot)
- read the contributing guide
- head to the schema where you want to add the test. Lets say the string schema, that is in string.go (easy right?)
- Find another test something like the Min method. Copy that and adapt it to the new test you are adding
- Head to zconst and add the issueCode for the test as a constant
- Head to /i18n/en/en.go and add the default message to the json like map
- Write a test for validate & one for parse in the {schema}_test.go and {schema}_validate_test.go files
- Add the new test to the reference.md in the docs (just one line with the test name like all the others under the specific schema)
- You are done! Congrats
- Make the PR and wait until I have a chance to see it. Please be patient, I'm lazy and it takes me quite a bit of time to get to the PRs some times.appy contributing!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers