Consider adding validators package
See original GitHub issueCurrently a lot of python tools just throw exceptions at us or even uses: .is_valid()
and .errors
properties. It is not type-safe at all. Sometimes it is hard to explain to people how to really use type-driven design and make invalid states unreachable.
My idea is that we need to write thin wrappers around popular typed validation packages: like pydantic
, cerebrus
, schema
, etc to return really typed things.
We also need to think about API to be expressive and recognisable enough.
Related: https://gist.github.com/maksbotan/14b4bebda2acab98cdd158f85a970855 CC @maksbotan
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:16 (13 by maintainers)
Top Results From Across the Web
In Angular, how to add Validator to FormControl after control is ...
Here's an example showing how you can add validators to an existing FormControl: this.form.controls["firstName"].setValidators([Validators.
Read more >Package Validation - .NET Blog - Microsoft Developer Blogs
Package Validation tooling will allow library developers to validate that their packages are consistent and well-formed. It involves validating ...
Read more >Validate - Go Packages
Package validator implements value validations for structs and individual fields based on tags. It can also handle Cross-Field and Cross-Struct validation ...
Read more >Package validator implements struct field validations - GitHub
Then one needs to add it to the list of validators and give it a "tag" name. validator.SetValidationFunc("notzz", notZZ).
Read more >validator - npm
String validation and sanitization. Latest version: 13.7.0, last published: a year ago. Start using validator in your project by running ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Shame on me! Not
validators
butparsers
!See https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/
Related article: https://blog.drewolson.org/declarative-validation
PureScript: https://pursuit.purescript.org/packages/purescript-validation/5.0.0 Kotlin: https://arrow-kt.io/docs/apidocs/arrow-core/arrow.core/-validated/