Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Extended StructureRoutingKit

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(.unprocessableContent) 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(.unprocessableContent) is thrown.