♻️ Refactor configuration validation

Replace spec with schema
This commit is contained in:
Andrey Antukh
2024-06-20 14:36:34 +02:00
parent 0a86d9d515
commit 9174bb140b
14 changed files with 267 additions and 344 deletions

View File

@@ -219,12 +219,10 @@
:length (d/nilv length 12)})))))
(defmethod v/-format ::schemaless-explain
[_ {:keys [schema] :as explanation} printer]
[_ explanation printer]
{:body [:group
(v/-block "Value" (v/-visit (me/error-value explanation printer) printer) printer) :break :break
(v/-block "Errors" (v/-visit (me/humanize (me/with-spell-checking explanation)) printer) printer) :break :break
(v/-block "Schema" (v/-visit schema printer) printer)]})
(v/-block "Errors" (v/-visit (me/humanize (me/with-spell-checking explanation)) printer) printer)]})
(defmethod v/-format ::explain
[_ {:keys [schema] :as explanation} printer]
@@ -233,7 +231,6 @@
(v/-block "Errors" (v/-visit (me/humanize (me/with-spell-checking explanation)) printer) printer) :break :break
(v/-block "Schema" (v/-visit schema printer) printer)]})
(defn pretty-explain
[explain & {:keys [variant message]
:or {variant ::explain