(explain-malli schema v)(explain-malli schema v opts)Prints a Malli validation error "callout" block via bling.core/callout.
Within the block, the value is pretty-printed, potentially with syntax
coloring. The problem value is highlighted with the :highlight-error
class of the active fireworks theme, or the :highlight-error-underlined
class, if the value is not a collection.
If three arguments are provided, the third should be a map with the following optional keys:
:function-name
string?:spacing
#{"compact" :compact}:spacing is set to :compact, the
callout is compacted vertically.:display-schema?
boolean?malli.core/explain.:display-explain-data?
boolean?malli.core/explain within the
callout block.:callout-opts
map?:hifi-opts
map?:file
string?:line
int?:column
int?:highlighted-problem-section-label
string?:section-body-indentation
pos-int?:preamble-section-label
string?:preamble-section-body
string?:success-message
string?
Prints a Malli validation error "callout" block via bling.core/callout.
Within the block, the value is pretty-printed, potentially with syntax
coloring. The problem value is highlighted with the `:highlight-error`
class of the active fireworks theme, or the `:highlight-error-underlined`
class, if the value is not a collection.
If three arguments are provided, the third should be a map
with the following optional keys:
* **`:function-name`**
- `string?`
- Optional.
- The name of the function that can be used to construct
the source location.
* **`:spacing`**
- `#{"compact" :compact}`
- Optional.
- If the value of `:spacing` is set to `:compact`, the
callout is compacted vertically.
* **`:display-schema?`**
- `boolean?`
- Optional.
- Displays the schema passed to the underlying call to
`malli.core/explain`.
* **`:display-explain-data?`**
- `boolean?`
- Optional.
- Displays the output of `malli.core/explain` within the
callout block.
* **`:callout-opts`**
- `map?`
- Optional.
- A map of options for the underlying call to
bling.core/callout.
* **`:hifi-opts`**
- `map?`
- Optional.
- The options map for bling.hifi/hifi
* **`:file`**
- `string?`
- Optional.
- The file name of the call site.
This value be automatially supplied by the macro,
so only use if you want to manually override
* **`:line`**
- `int?`
- Optional.
- The line number of the call site.
This value be automatially supplied by the macro,
so only use if you want to manually override.
* **`:column`**
- `int?`
- Optional.
- The column number of the call site.
This value be automatially supplied by the macro,
so only use if you want to manually override.
* **`:highlighted-problem-section-label`**
- `string?`
- Optional.
- Label for the highlighted problem diagram
* **`:section-body-indentation`**
- `pos-int?`
- Optional.
- Number of spaces to indent the body of each section
* **`:preamble-section-label`**
- `string?`
- Optional.
- The label of the preamble section
* **`:preamble-section-body`**
- `string?`
- Optional.
- The body of the preamble section
* **`:success-message`**
- `string?`
- Optional.
- The message to display if value passes schema validation(explain-malli* schema v)(explain-malli*
schema
v
{:keys [highlighted-problem-section-label select-keys-in-problem-path?
section-body-indentation preamble-section-label preamble-section-body
display-explain-data? section-label-style omit-section-labels
display-schema? success-message file-info-str omit-sections
callout-opts hifi-opts spacing column file line]
:or {success-message :bling.explain/explain-malli-success
section-label-style {:font-style :italic :color :subtle}}
:as opts})(regrouped-errors grouped-errors)This is intended to reduce the number of errors that are reported.
Should only work when:
This is intended to reduce the number of errors that are reported. Should only work when: - There are multiple errors in the erroneous values's error group - 2 or more errors are siblings based on their schema :path value - The grouped siblings with the longest path are used, and all other errors are discarded
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |