Liking cljdoc? Tell your friends :D

s-exp.legba


default-optionsclj

Default options used by openapi-handler

Default options used by openapi-handler
raw docstring

handlersclj

(handlers routes schema & {:as opts})

From a map of [method path] -> ring handler returns a map of [method path] -> openapi-wrapped-handler.

Options:

  • :key-fn - Control map keys decoding when turning jackson JsonNodes to clj data for the handler - default to keyword

  • :query-string-params-key - where to find the decoded query-string parameters - defaults to :query-params

  • :validation-result - function that controls how to turn com.networknt.schema.ValidationResult into a clj -> json response. Defaults to s-exp.legba.schema/validation-result

From a map of [method path] -> ring handler returns a map of [method path] ->
openapi-wrapped-handler.

Options:

* `:key-fn` - Control map keys decoding when turning jackson JsonNodes to clj
  data for the handler - default to `keyword`

* `:query-string-params-key` - where to find the decoded query-string
   parameters - defaults to `:query-params`

* `:validation-result` - function that controls how to turn
  `com.networknt.schema.ValidationResult` into a clj -> json response. Defaults
  to `s-exp.legba.schema/validation-result`
raw docstring

routing-handlerclj

(routing-handler routes schema & {:as opts})

Same as routing-handler* but wraps with s-exp.legba.middleware/wrap-error-response middleware turning exceptions into nicely formatted error responses

Same as `routing-handler*` but wraps with
`s-exp.legba.middleware/wrap-error-response` middleware turning exceptions
into nicely formatted error responses
raw docstring

routing-handler*clj

(routing-handler* routes schema & {:as opts :keys [path-params-key]})

Takes a map of routes as [method path] -> ring-handler, turns them into a map of routes to openapi handlers then creates a handler that will dispatch on the appropriate openapi handler from a potential router match. If not match is found, returns not-found-response.

Options:

  • :not-found-response - defaults to {:status 404 :body " Not found "}

  • :key-fn - Control map keys decoding when turning jackson JsonNodes to clj data for the handler - default to keyword

  • :query-string-params-key - where to find the decoded query-string parameters - defaults to :query-params

  • :validation-result - function that controls how to turn com.networknt.schema.ValidationResult into a clj -> json response. Defaults to s-exp.legba.schema/validation-result

  • :extra-routes - extra routes to be passed to the underlying reitit router (using {:syntax :bracket})

Takes a map of routes as [method path] -> ring-handler, turns them into a map
of routes to openapi handlers then creates a handler that will dispatch on the
appropriate openapi handler from a potential router match. If not match is
found, returns `not-found-response`.

Options:

* `:not-found-response` - defaults to `{:status 404 :body " Not found "}`

* `:key-fn` - Control map keys decoding when turning jackson JsonNodes to clj
  data for the handler - default to `keyword`

* `:query-string-params-key` - where to find the decoded query-string
   parameters - defaults to `:query-params`

* `:validation-result` - function that controls how to turn
  `com.networknt.schema.ValidationResult` into a clj -> json response. Defaults
  to `s-exp.legba.schema/validation-result`

* `:extra-routes` - extra routes to be passed to the underlying reitit router
  (using `{:syntax :bracket}`)
raw docstring

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

× close