I was following along a screen cast from Ray Wenderlich (https://videos.raywenderlich.com/screencasts/545-server-side-swift-with-vapor-basic-validation) (which doesn't have a compilable project) when I tried to type
let input: Valid<OnlyAlphanumeric> = try request.data["input"].validated()
And the compiler told me Valid doesn't exist. I tried looking for this and found that Vapor doesn't do the validation like this anymore and that it uses different lines found here: https://stackoverflow.com/a/45363444/2305517 which are:
guard let input = req.data["input"]?.string else { throw SomeError }
try input.validated(by: OnlyAlphanumeric())
However strings don't have a function called validated(by:)
I tried importing Validation but the module doesn't exist.
Is there a way to complete the tutorial now? Validation doesn't appear to be in the Vapor code at all.