Skip to content

Commit

Permalink
doc: fix Between example in README.md
Browse files Browse the repository at this point in the history
a typo in the predicate caused the schema to always fail
  • Loading branch information
opqdonut committed Nov 12, 2024
1 parent 16623e2 commit 74ccbe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2775,7 +2775,7 @@ You can also build content-dependent schemas by using a callback function `:comp
:compile (fn [_properties [min max] _options]
(when-not (and (int? min) (int? max))
(m/-fail! ::invalid-children {:min min, :max max}))
{:pred #(and (int? %) (>= min % max))
{:pred #(and (int? %) (<= min % max))
:min 2 ;; at least 1 child
:max 2 ;; at most 1 child
:type-properties {:error/fn (fn [error _] (str "should be between " min " and " max ", was " (:value error)))
Expand Down

0 comments on commit 74ccbe5

Please sign in to comment.