Default options used by openapi-handler
Default options used by openapi-handler
(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 :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 `: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`
(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
(routing-handler* routes schema & {:as opts})
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 :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 `: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}`)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close