-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Default attribute should make the property required #153
Comments
Hmm I think it really depends on the context. Consider those two cases:
So I think it should be configured through an option: The question now is what is default behavior of WDYT ? |
I think it totally make sense. |
Much needed feature guys, let me know if it is on the roadmap or whether you are open to pull requests. |
Feature is now available in the v3: #153 🙌 Wasn't so long to implement, sorry for the delay ! |
Interesting take. I think the use case of pre/post validation would be 50/50. The interface/function doing the validation of the raw data would need In my specific case I don't need to validate the data with defaults applied, since I'm calling into another API that will apply necessary defaults for me. Of course this change doesn't really causes any issues, since the |
Currently a schema like this:
results in this type:
I believe that a property with a defined default value should be treated as not optional, resulting in a type like the following:
What do you think?
The text was updated successfully, but these errors were encountered: