import Vapor extension Request { func ensureValidContent(_ decoding: T.Type) throws -> T where T: Content, T: Validatable { try T.validate(content: self) return try content.decode(T.self) } }