Pantelis Sampaziotis
14f963703b
Add datetime validation
5 years ago
Pantelis Sampaziotis
9e58bcdee1
Empty strings are not lowercase or uppercase
5 years ago
Pantelis Sampaziotis
5b51bff4e6
Add isLowercase and isUppercase valitation
5 years ago
Pantelis Sampaziotis
581d2698d5
Added isJSON validation
5 years ago
Ravi Terala
893747e5ee
Add hostname_port validator feature
5 years ago
Shi Han NG
8f604265e0
Implement unique=FieldName
5 years ago
Taylor
e7c70798c9
Add e.164 support
5 years ago
Nguyễn Văn Hưng
da6897303a
error is always nil
5 years ago
Jonathan Thom
685d3e21f3
Makes regex constant & moves single quote replace logic to parseOneOfParam2
5 years ago
Dmitry M. Gavrovsky
dfc652373a
Added boolean type support for “eq” validator
5 years ago
Dean Karn
c0f05c7b3d
fix required_*
5 years ago
Jonathan Thom
432c17028a
Adds ability to validate oneof for space separated strings
...
Fixes Or Enhances https://github.com/go-playground/validator/issues/525 .
**Make sure that you've checked the boxes below before you submit PR:**
- [x] Tests exist or have been written that cover this particular change.
Change Details:
* Adds the ability to match on space separated strings when using the
`oneof` validation. Space separted strings must be surrounded by single
quotes to be validated as one string. For example:
```
oneof='Awaiting Verification' 'Verified' 'Failed Verification'
```
passes validation for a field that is exactly `Failed Verification`
(though just `Failed` would...fail).
@go-playground/admins
5 years ago
Dean Karn
6484d9f2fb
fix required_with_*
5 years ago
Dean Karn
cc25246f01
fix required_without_*
5 years ago
Zuyang Kou
54db112759
Make `required_without` work with pointer
...
Fix #483 , #473
6 years ago
A Mashmooli
8c221696bb
simplify required check field kind
6 years ago
A Mashmooli
3ec10f9949
add required_without_all validator
6 years ago
A Mashmooli
03bfd38cc1
add required_without validator
6 years ago
A Mashmooli
ebfddc5784
add required_with_all validator
6 years ago
A Mashmooli
1e6bddb6b3
fix comment
6 years ago
A Mashmooli
adbd5e9b33
add required_with validator
6 years ago
Tyler Cipriani
3945da16ee
Add `startswith` and `endswith` validators
...
`HasPrefix` and `HasSuffix` are both part of the `strings` package.
These seem like generally useful validations to include and cover some
subset of the use-cases of a general regex validator without having any
of the problems outlined by the validator docs.
6 years ago
Andrei Avram
1d286c8332
Define NotBlank as non standard validator.
6 years ago
Andrei Avram
6b29637aaa
Add NotBlank validation function.
...
For validating if the current field has a value or length greater than zero.
6 years ago
Abdallah Galal
94ba218708
Add validation for directories
6 years ago
Ramy Aboul Naga
cbd5cf6393
Use type switch in favor of fmt.Sprint
6 years ago
Rohan Sathe
76020d061e
Fixes #26 ( #437 )
6 years ago
Ramy Aboul Naga
52ea448998
Allow latitude/longitude validation for numeric values
6 years ago
franklin
91d81934ab
Add baked in validators for containsfield and excludesfield ( #424 )
...
* Add baked in validators for containsfield and excludesfield
* Add ContainsAndExcludes test
* Add NotEqual tests before AssertError
* Add tests for missing fields
* containsfield -> fieldcontains, excludesfield -> fieldexcludes
6 years ago
Leonardo Di Donato
0482874b86
Update: Rename urn tag into urn_rfc2141
...
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
6 years ago
Leonardo Di Donato
c5423e4116
New: URN
...
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
6 years ago
heatwole
0a9b75fbfd
Adding html and url encoding and updating docs
7 years ago
Noi Bar
f2fdb60d7d
Add file path validation
7 years ago
Dean Karn
ffe836d736
Expanded numeric & number validations
...
It was originally intended for these to only be used on strings, however
it makes sense to also use them if your dealing with type interface{}
so now ints and floats return true for this validation also as they are
both numeric and numbers.
closes #356
7 years ago
Dean Karn
54da7fa48f
fix linting and spelling errors
7 years ago
James Service
d978a4b421
Undo whitespace changes from gofmt.
7 years ago
James Service
8ae3903dd3
Extend the unique tag to also cover map values.
7 years ago
josh
073682ea75
added in more test cases and removed some redundant validation steps
7 years ago
josh
ce6284a6fc
confirm only all upper or all lower case address are valid
7 years ago
josh
6deddf27eb
proper bech32 address validation
7 years ago
josh
3df85bdcfc
p2sh validation and more tests
7 years ago
josh
60417282a4
verifies p2pkh addresses
7 years ago
josh
36d83b0b83
Added in validation function, tests, and docs
7 years ago
Kyriakos Georgiou
030800a855
Add validation for base64 URL safe values
7 years ago
Russ Egan
2e9adc3329
swapped mutex for rwmutex
...
similiar single-goroutine performance, slightly better concurrent performance.
7 years ago
Russ Egan
15217303f9
Add oneof validation
...
Validates that a string or number value equals one of a set of allowed values. Examples:
validator.Var(“red”, “oneof=red green”)
validator.Var(6, “oneof=6 7 8”)
7 years ago
Dean Karn
5e036656b8
Add hostname_rfc1123 validation
7 years ago
Dean Karn
61caf9d303
add map key validation support ( #324 )
7 years ago
Dean Karn
11a1fab51d
Add unique validation
7 years ago
Dean Karn
f16354ec03
Add isdefault + fix fqdn
...
Closes #299
Fixes #306
7 years ago