Liking cljdoc? Tell your friends :D

reitit.coercion


-compile-parametersclj/s

(-compile-parameters data coercion)
source

-identity-coercerclj/s

(-identity-coercer value _format)
source

-warn-unsupported-coercionsclj/s

(-warn-unsupported-coercions {:keys [parameters responses] :as _data})
source

coerce!clj/s

(coerce! match)

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

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

coerce-requestclj/s

(coerce-request coercers request)
source

coerce-responseclj/s

(coerce-response coercers request response)
source

Coercionclj/sprotocol

Pluggable coercion protocol

Pluggable coercion protocol

-compile-modelclj/s

(-compile-model this model name)

Compiles a model

Compiles a model

-encode-errorclj/s

(-encode-error this error)

Converts error in to a serializable format

Converts error in to a serializable format

-get-apidocsclj/s

(-get-apidocs this specification data)

Returns api documentation

Returns api documentation

-get-nameclj/s

(-get-name this)

Keyword name for the coercion

Keyword name for the coercion

-get-optionsclj/s

(-get-options this)

Coercion options

Coercion options

-open-modelclj/s

(-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-coercerclj/s

(-request-coercer this type model)

Returns a value format => value request coercion function

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

-response-coercerclj/s

(-response-coercer this model)

Returns a value format => value response coercion function

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

compile-request-coercersclj/s

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

A router :compile implementation which reads the :parameters and :coercion data to both compile the schemas and create compiled coercers into Match under `:result with the following keys:

keydescription
:datadata with compiled schemas
:coercefunction of Match -> coerced parameters to coerce parameters

A pre-requisite to use coerce!.

NOTE: this is not needed with ring/http, where the coercion compilation is managed in the request coercion middleware/interceptors.

A router :compile implementation which reads the `:parameters`
and `:coercion` data to both compile the schemas and create compiled coercers
into Match under `:result with the following keys:

 | key       | description
 | ----------|-------------
 | `:data`   | data with compiled schemas
 | `:coerce` | function of `Match -> coerced parameters` to coerce parameters

A pre-requisite to use [[coerce!]].

NOTE: this is not needed with ring/http, where the coercion compilation is
managed in the request coercion middleware/interceptors.
sourceraw docstring

encode-errorclj/s

(encode-error data)
source

error?clj/s

(error? x)
source

extract-request-format-defaultclj/s

(extract-request-format-default request)
source

extract-response-format-defaultclj/s

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

get-apidocsclj/s

(get-apidocs coercion specification data)
source

request-coercerclj/s

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

request-coercersclj/s

(request-coercers coercion parameters opts)
source

response-coercerclj/s

(response-coercer coercion
                  {:keys [content body]}
                  {:keys [extract-response-format serialize-failed-result]
                   :or {extract-response-format
                          extract-response-format-default}})
source

response-coercersclj/s

(response-coercers coercion responses opts)
source

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

× close