Parses the value for a particular field specification, dispatching on :datatype if present, otherwise :type. Takes [field-spec value] as arguments.
Parses the value for a particular field specification, dispatching on :datatype if present, otherwise :type. Takes [field-spec value] as arguments.
(parse-params form-or-fields params & {:keys [validate] :or {validate true}})
Given a form specification or sequence of field specifications and a Ring params map or form data string, returns a map of field names to parsed values.
The Ring params map must be either 1) an untouched :query-params, :form-params, or :multipart-params map; or 2) a params map with the following middleware applied: wrap-params, wrap-nested-params, wrap-keyword-params.
Parsed values will be validated and an exception will be thrown if validation fails. The exception carries a :problems key with details about the validation failure.
Keyword options: :validate - set to false to not validate parsed values
Given a form specification or sequence of field specifications and a Ring params map or form data string, returns a map of field names to parsed values. The Ring params map must be either 1) an untouched :query-params, :form-params, or :multipart-params map; or 2) a params map with the following middleware applied: wrap-params, wrap-nested-params, wrap-keyword-params. Parsed values will be validated and an exception will be thrown if validation fails. The exception carries a :problems key with details about the validation failure. Keyword options: :validate - set to false to not validate parsed values
(parse-request form-or-fields req)
Given a form specification or sequence of field specifications and a Ring request, returns a map of form field names to parsed values. Checks :multipart-params first, then :form-params, then :query-params.
Given a form specification or sequence of field specifications and a Ring request, returns a map of form field names to parsed values. Checks :multipart-params first, then :form-params, then :query-params.
(with-fallback fallback-fn & body)
Attempts to run body; if an ExceptionInfo with a :problems key is caught, calls fallback-fn with the problems as the argument.
Attempts to run body; if an ExceptionInfo with a :problems key is caught, calls fallback-fn with the problems as the argument.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close