Fork me on GitHub

Hey folks 👋 Why explain keeps passing values forward when previous operations in an and condition have already failed?

     [:and string?
      [:not {:error/message "non empty string"} empty?]]]]
   {:name 1})
The example above throws Don't know how to create ISeq from: java.lang.Long. It does at (empty? 1). The conditions are concatenated with an and operator, so I wasn't expecting [:not {:error/message "non empty string"} empty?] to run because string? failed in the first place. Note: there are probably better ways to express a non-empty string with Malli 😅

Martín Varela07:06:24

[:string {:min 1}] is probably what you're after...

👍 8

yes, I think it’s better to have keyword types (e.g. :string) with properties than to use the existing core functions, of which, many throw on invalid input.


e.g. post-int? vs [:int {:min 1}]


@U95NTJT4H thanks for the suggestion – I knew there was a better way to solve that problem.

👍 2
Martín Varela11:06:12

Glad that helped 🙂


@U055NJ5CC got it. For custom keyword types, we would have to provide a registry, right?


So, I assume Malli will check the value against every keyword type of a field, even when using an AND operator and the first check fails, in order to get a complete errors map in the first run :thinking_face:


Hi! I try to use malli as coercion&schemas with swagger ui. If i try serialise recursive schemas with registries, i get some "Could not resolve reference" of keys of recursive values. it is according to plan and swagger bad, or its just undone feature?) looks like there is some missing defs in swagger.json


@UNJE65T24 It might be that the references should copied to top-level swagger. If you can provide a minimal repro, would help solving


also, what version of swagger-ui are you using?


@U055NJ5CC i use swagger-ui bundled with

[metosin/reitit-swagger-ui "0.5.13"]
[metosin/ring-swagger-ui "3.36.0"]
guess it 3.XX


i'v got example of that malli


if i malli.json-schema/transform this (it is used in swagger gen, right?) i get something like


and it has no valuable

as you can see


should i submit an issue to github?)