Liking cljdoc? Tell your friends :D

sturdy.malli-firewall.web


*bad-request-handler*clj

Users can bind this to a custom function, e.g. a ring handler for 400 error responses.

Users can bind this to a custom function, e.g. a ring handler for
400 error responses.
sourceraw docstring

*strip-unknown-keys*clj

If *strip-unknown-keys* is truthy (default), unknown keys are silently dropped. This prevents interning or processing any unwanted input.

If *strip-unknown-keys* is falsey, unknown keys are kept in the map, but are left as strings. This enables closed schemas to fail validation, while still avoiding interning arbitrary user input.

If `*strip-unknown-keys*` is truthy (default), unknown keys are
silently dropped.  This prevents interning or processing any
unwanted input.

If `*strip-unknown-keys*` is falsey, unknown keys are kept in the
map, but are left as strings.  This enables closed schemas to fail
validation, while still avoiding interning arbitrary user input.
sourceraw docstring

bad-request-responseclj

(bad-request-response request details)
source

format-schema-errorclj

(format-schema-error details)

Format a structured error response as a simple string, for handlers which do not support structured logging.

Format a structured error response as a simple string, for handlers
which do not support structured logging.
sourceraw docstring

with-schemacljmacro

(with-schema schema request & body)

Coerces and validates request params against schema.

On success: Updates :params in the request with coerced values and executes body. On failure: Short-circuits and returns a 400 Bad Request via bad-request-response.

Uses the dynamic variables bad-request-handler to format 400 responses strip-unknown-keys to control behavior for unknown keys See the docstrings for these symbols for more information.

Usage: (with-schema schema/LoginRequest request (handler request))

Coerces and validates request params against schema.

On success: Updates :params in the request with coerced values
and executes body.
On failure: Short-circuits and returns a 400 Bad Request via
bad-request-response.

Uses the dynamic variables
  *bad-request-handler* to format 400 responses
  *strip-unknown-keys* to control behavior for unknown keys
See the docstrings for these symbols for more information.

Usage:
   (with-schema schema/LoginRequest request
     (handler request))
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close