hzy
9365ff2585
empty map validate fix
1 year ago
hzy
430edf2247
map array validate fix
1 year ago
hzy
e3e24a10a9
struct can be null flag
1 year ago
hzy
3cac6d154d
struct can be null flag
1 year ago
hzy
0e6a5850b2
discriminate map validate and map array validate
2 years ago
Yasoob Haider
29d50ba963
add validation for base64 url without = padding ( #1024 )
...
Co-authored-by: Yasoob Haider <yasoob.haider@zomato.com>
Co-authored-by: Dean Karn <Dean.Karn@gmail.com>
2 years ago
Dean Karn
02c12dd7ef
update RegisterStructValidationMapRules docs
3 years ago
Leo Liang
d0d0c355aa
Feat: support validate struct without struct tag ( #934 )
3 years ago
Jason.Zhang
d3e4be3e44
Enhanced ValidationCtx method to support nested map in slice #915 ( #917 )
3 years ago
gosua
99922fccc7
Enhance example in function docu ( #858 )
3 years ago
Lauris BH
f09500fca7
Fix support for aliased time.Time types ( #890 )
3 years ago
Sol
24b5175a34
Fix typo ( #891 )
3 years ago
Jacob Hochstetler
c0195b2b40
added excluded_if/excluded_unless tags + tests ( #847 )
3 years ago
András Czigány
42525d89ab
document thread safety and recommended singleton usage ( #809 )
3 years ago
Oleg Nikachev
44c2696cbd
Minor fixes. ( #798 )
...
Fixed README.md. Added missing tags.
Fixed function names in comments in baked_in.go.
Fixed error strings in validator_instance.go (should not be
capitalized).
Fixed twice imported assert package in validator_test.go.
3 years ago
zytell3301
b95d43b789
Add ability to validate map data ( #752 )
...
* Implement ValidateMapCtx func for validating map data
* Add ValidateMap func for validating map data with an empty context
* Implement a basic example of ValidateMap method
* Update ValidateMapCtx method, so it can validate nested maps
* Due to changes in ValidateMapCtx, make some updates on ValidateMap method
* Update tests due to changes in ValidateMap method
* Create a basic test for validating nested maps
* Handle error when invalid data is supplied for diving
4 years ago
Michał Treter
ec1baac93d
Fix accessing fields in composed structs ( #733 )
4 years ago
Jake-Convictional
9c415c4565
Add support for excluded_with on pointer fields ( #746 )
4 years ago
hzw
44a150f359
add required_if and required_unless
4 years ago
Elias Rodrigues
55e0f418d6
Minor edits
4 years ago
Elias Rodrigues
0c71d5cc08
Add var timeDurationType
4 years ago
Dean Karn
cc25246f01
fix required_without_*
5 years ago
andreas
8ed00e2e12
Change behavior instead of error, we Indirect it to get the non-pointer value
6 years ago
andreas
9eeca29136
detail error message on RegisterStructValidationCtx finding pointer arg
6 years ago
andreas
5b14fca011
Returns error when passing pointer to RegisterStructValidation
6 years ago
Duncan Holm
29b73202fe
Document RegisterTagNameFunc more
6 years ago
Damir Vandic
bdae516532
Fix unused ctx in StructFilteredCtx
6 years ago
Tengis B
8d3aa5bde2
✏️ fixed typo in comment
7 years ago
Dean Karn
54da7fa48f
fix linting and spelling errors
7 years ago
Dean Karn
5e036656b8
Add hostname_rfc1123 validation
7 years ago
Dean Karn
e00f5e092a
split out to function, defer is needed to handle panics
7 years ago
Dean Karn
b962f3d7d5
Correct Var tagCache locking
7 years ago
Dean Karn
61caf9d303
add map key validation support ( #324 )
7 years ago
Aaron Lehmann
770163b1e1
Documentation fixes
...
This fixes a few documentation issues I noticed.
- Explain what Func is supposed to return.
- Remove change reference to ActualNamespace to mention StructNamespace
instead.
- Remove references to Validatable, which no longer exists.
- Fix godoc formatting.
- Delete extra text from ReportValidationErrors comment.
- Change ReportError interface definition so its arguments are named
consistently with what they do.
7 years ago
Dean Karn
0b5dc7605b
Add isdefault validation
7 years ago
Dean Karn
0f6f568263
Add contextual validation support via context.Context ( #296 )
...
* Add contextual validation support via context.Context
Added:
- RegisterValidationCtx
- RegisterStructValidationCtx
- StructCtx
- StructFilteredCtx
- StructPartialCtx
- StructExceptCtx
- VarCtx
- VarWithValueCtx
7 years ago
Dean Karn
493dfb6209
correct required tag functionality for pointers, now works like old `exists` tag.
8 years ago
Dean Karn
506cc5da56
Add Filter logic
8 years ago
Jawher Moussa
73e8e76de2
Fix universal translator imports so that goimports doesn't get remove them
...
Running goimports on the codebase deletes all the imports of "github.com/go-playground/universal-translator".
The fix consists of explicitly qualifying the import statements with ut.
8 years ago
Dean Karn
a7ca4a1d32
add default translations for "en"
...
- need help creating more.
8 years ago
Dean Karn
532878b008
initial translation/custom error code
8 years ago
joeybloggs
ecad6333b1
increase dive tag performance.
8 years ago
joeybloggs
d9bfef9fe0
speed up structPartial and structExcept string parsing
8 years ago
joeybloggs
8d0fd80a80
removed creation of a couple stack variables and creation of errors
8 years ago
joeybloggs
98dee40973
perf updates all around!
8 years ago
joeybloggs
8c60a612c5
code coverage back to 100% + some code cleanup
8 years ago
joeybloggs
5fedd8c08a
buffer errTag + errs array.
8 years ago
joeybloggs
1ff58be284
finish conversion of test + some fixes.
8 years ago
joeybloggs
e0e1af6a61
working instance
8 years ago