github vapor/vapor 4.0.0-beta.3.14
Add .valid for decoding only validation

latest releases: 4.95.0, 4.94.1, 4.94.0...
pre-release4 years ago

Fixes #2154.

  • Adding a validation .valid which does not actually validate something except the automatically thrown decoding errors.
  • Adding .valid as default validation if no validation is provided.
// OLD (+ workaround for bool)
validations.add("foo", as: Bool.self, is: .in([true, false])) 

// NEW 
validations.add("foo", as: Bool.self, is: .valid)
validations.add("foo", as: Bool.self) // is: can be omitted
validations.add("foo", as: Date.self) // works for all kind of properties

Don't miss a new vapor release

NewReleases is sending notifications on new releases.