Add better string validation
See original GitHub issueCases with JsonDecoder.string
make the key required to be a string, but sometimes the string can be an empty one e.g. ""
. Another case, would be when the value can be any string other than certain values e.g. would fail on "STOP"
.
In my case I need to ensure empty strings for required keys fail. Is there a way to do that?
In my eyes I see 2 ways to solve this 1) an opt-in feature to fail on an empty string value in case of a required key, 2) add an optional exclude value array for strings e.g. { exclude: ["value1", "value2"] }
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Making string validation faster by not using a regular ...
Our common sense told us this would not be better, but the only way to find out is by trying. Candidate 2: using...
Read more >Adding Number Validation to a String - java - Stack Overflow
It is a java implementation. This idea is very similar to android. For jave, instead of using ((EditText)findViewbyId(R.id.
Read more >Versatile string validation - Code Review Stack Exchange
A string is valid if it satisfies the rules below: The string must be at least 6 characters long and not exceed 16...
Read more >Active Record Validations - Ruby on Rails Guides
Active Record offers many pre-defined validation helpers that you can use directly inside your class definitions. These helpers provide common validation rules.
Read more >validatorjs/validator.js: String validation - GitHub
If you're not sure if your input is a string, coerce it using input + '' . Passing anything other than a string...
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
https://github.com/joanllenas/ts.data.json#jsondecoderallof
My bad. Thanks