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

feat: add default none to pydantic validators #116

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

rzlim08
Copy link
Collaborator

@rzlim08 rzlim08 commented Oct 16, 2024

  • Creates a default None value for the pydantic validators
  • Allows the pydantic validators to be used directly

@rzlim08 rzlim08 requested a review from jgadling October 16, 2024 23:47
@jgadling
Copy link
Contributor

Do you mind explaining why the default None makes the validators easier to use? @rzlim08

@rzlim08
Copy link
Collaborator Author

rzlim08 commented Oct 17, 2024

Do you mind explaining why the default None makes the validators easier to use? @rzlim08

Yep, since we're using the validators directly, this allows for the case where you don't want to set all of the optional variables, for example for Update events only having to set the variable that you want to change. I think we didn't have to do this before because we were combining the validators with the Strawberry Types which already have defaults.

@rzlim08 rzlim08 merged commit 1af830c into main Oct 18, 2024
4 checks passed
@rzlim08 rzlim08 deleted the rlim/add-default-none-to-pydantic-validators branch October 18, 2024 17:28
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.

2 participants