Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Releases: vapor/validation

Validation 2.1.1

30 Oct 18:06
4de213c
Compare
Choose a tag to compare

Fixed:

  • Improved error messages for CountValidator and RangeValidator. (#31)

Validation 1.1.2

03 Oct 20:39
1fd71c5
Compare
Choose a tag to compare
Merge pull request #30 from cweinberger/vapor-2

Critical updates for Swift 4.2, fix warnings

Validation 2.1.0

09 Aug 01:16
156f8ad
Compare
Choose a tag to compare

New:

  • Added .url validator. (#28)
try validations.add(\.profilePictureURL, .url || .nil)
  • Added .empty validator. (#27)
try validations.add(\.preferedColors, !.empty)

Validation 2.0.0

11 Apr 19:16
Compare
Choose a tag to compare

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

22 Mar 20:15
aa12fbd
Compare
Choose a tag to compare
Pre-release

New:

  • Use Core.Reflectable protocol.

Milestone

Validation 2.0.0 RC 2

21 Mar 21:12
Compare
Choose a tag to compare
Validation 2.0.0 RC 2 Pre-release
Pre-release

New:

  • Vapor is now running on Swift NIO!

Milestone

Validation 2.0.0 RC 1

23 Feb 06:11
683af11
Compare
Choose a tag to compare
Validation 2.0.0 RC 1 Pre-release
Pre-release
Merge pull request #16 from vapor/beta

validation 2.0 beta

Validation 2.0.0 Beta 2

22 Feb 08:08
Compare
Choose a tag to compare
Pre-release

New:

  • Update to latest core dependency.

Validation 2.0.0 Beta 1.1

15 Feb 02:56
Compare
Choose a tag to compare
Pre-release
2.0.0-beta.1.1

prerelease version updates

Validation 2.0.0 Beta 1

13 Feb 01:20
Compare
Choose a tag to compare
Pre-release
2.0.0-beta.1

validation beta