Liking cljdoc? Tell your friends :D

reitit.coercion


coerce!

(coerce! match)

Returns a map of coerced input parameters using pre-compiled coercers under :result (provided by compile-request-coercers. Throws ex-info if parameters can't be coerced If coercion or parameters are not defined, return nil

Returns a map of coerced input parameters using pre-compiled
coercers under `:result` (provided by [[compile-request-coercers]].
Throws `ex-info` if parameters can't be coerced
If coercion or parameters are not defined, return `nil`
sourceraw docstring

coerce-request

(coerce-request coercers request)
source

coerce-response

(coerce-response coercers request response)
source

Coercionprotocol

Pluggable coercion protocol

Pluggable coercion protocol
-compile-model
(-compile-model this model name)

Compiles a model

Compiles a model

-encode-error
(-encode-error this error)

Converts error in to a serializable format

Converts error in to a serializable format

-get-apidocs
(-get-apidocs this specification data)

Returns api documentation

Returns api documentation

-get-name
(-get-name this)

Keyword name for the coercion

Keyword name for the coercion

-get-options
(-get-options this)

Coercion options

Coercion options

-open-model
(-open-model this model)

Returns a new model which allows extra keys in maps

Returns a new model which allows extra keys in maps

-request-coercer
(-request-coercer this type model)

Returns a value format => value request coercion function

Returns a `value format => value` request coercion function

-response-coercer
(-response-coercer this model)

Returns a value format => value response coercion function

Returns a `value format => value` response coercion function

sourceraw docstring

CoercionError

source

compile-request-coercers

(compile-request-coercers [_ {:keys [parameters coercion]}] opts)

A router :compile implementation which reads the :parameters and :coercion data to create compiled coercers into Match under `:result. A pre-requisite to use coerce!.

A router :compile implementation which reads the `:parameters`
and `:coercion` data to create compiled coercers into Match under
`:result. A pre-requisite to use [[coerce!]].
sourceraw docstring

encode-error

(encode-error data)
source

error?

(error? x)
source

extract-request-format-default

(extract-request-format-default request)
source

extract-response-format-default

(extract-response-format-default request _)
source

get-apidocs

(get-apidocs this specification data)
source

ParameterCoercion

source

request-coercer

(request-coercer
  coercion
  type
  model
  {:keys [:reitit.coercion/extract-request-format
          :reitit.coercion/parameter-coercion],
   :or {extract-request-format extract-request-format-default,
        parameter-coercion default-parameter-coercion}})
source

request-coercers

(request-coercers coercion parameters opts)
source

response-coercer

(response-coercer coercion
                  body
                  {:keys [extract-response-format],
                   :or {extract-response-format
                          extract-response-format-default}})
source

response-coercers

(response-coercers coercion responses opts)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close