This repository has been archived by the owner on Nov 16, 2020. It is now read-only.
Releases: vapor/validation
Releases · vapor/validation
Validation 2.1.1
Fixed:
- Improved error messages for
CountValidator
andRangeValidator
. (#31)
Validation 1.1.2
Merge pull request #30 from cweinberger/vapor-2 Critical updates for Swift 4.2, fix warnings
Validation 2.1.0
Validation 2.0.0
Validation 2.0 is here! 🎉
✅ Extensible data validation library (name, email, etc)
Docs:
https://docs.vapor.codes/3.0/validation/getting-started/
API Docs:
https://api.vapor.codes/validation/latest/Validation
Milestone:
2.0.0
Changes since final release candidate:
Validation was in need of some love before the official release. The APIs have been streamlined quite a bit.
Validators
are now accessed via leading-dot syntax instead of globally available types.Validatable
now requires a static function instead of a static property.Validations
are now generic.ValidationData
has been removed in favor of type-safe alternative.- Separate Range and Count validators.
- New CharacterSet validator.
Here's an example of how the API looks now compared to previous release:
2.0.0
struct User: Validatable, Reflectable, Codable {
var id: Int?
var name: String
var age: Int
var email: String?
static func validations() throws -> Validations<User> {
var validations = Validations(User.self)
try validations.add(\.name, .count(5...) && .alphanumeric)
try validations.add(\.age, .range(18...))
try validations.add(\.email, .email || .nil)
return validations
}
}
2.0.0-rc
struct User: Validatable, Reflectable, Codable {
var id: Int?
var name: String
var age: Int
var email: String?
static var validations: Validations = [
key(\.name): IsCount(5...) && IsAlphanumeric(),
key(\.age): IsCount(18...),
key(\.email): IsEmail() || IsNil()
]
}
Validation 2.0.0 RC 2.1
Validation 2.0.0 RC 2
Validation 2.0.0 RC 1
Merge pull request #16 from vapor/beta validation 2.0 beta
Validation 2.0.0 Beta 2
New:
- Update to latest core dependency.
Validation 2.0.0 Beta 1.1
2.0.0-beta.1.1 prerelease version updates
Validation 2.0.0 Beta 1
2.0.0-beta.1 validation beta