Extension (Structure)vapor 4.106.7all tags

Parameters (ext)

You’re viewing third-party extensions to Parameters, a struct from routing-kit.

You can also read the documentation forParameters itself.

extension Parameters

Extension in Vapor

Instance members

  • func require(String) throws -> String

    Grabs the named parameter from the parameter bag. If the parameter does not exist, Abort(.internalServerError) is thrown. If the parameter value cannot be converted to String, Abort(.unprocessableEntity) is thrown.

  • func require<T>(String, as: T.Type) throws -> T

    Grabs the named parameter from the parameter bag, casting it to a LosslessStringConvertible type. If the parameter does not exist, Abort(.internalServerError) is thrown. If the parameter value cannot be converted to the required type, Abort(.unprocessableEntity) is thrown.