Skip to content

Extended Structure

Parameters

extension Parameters

Topics

Instance Methods

  • 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.