sorry if I missed something basic, but is there a way to specify that a string field should match a regular expression, without resorting to SCI functions?
https://github.com/metosin/malli/blob/master/test/malli/core_test.cljc#L484-L509
any documentation PRs most welcome
thanks!
@ikitommi can I trouble you for one more gist comment? this is not urgent so I’m happy to wait until your status is not “vacationing” 🙂 https://gist.github.com/stevebuik/e63735d99fca94041120f9b0e25b616d
thanks for the awesome repro, easy to dig in to this when have the extra time.
Thank you for such a big upgrade to Spec 🙂 BTW I’m also noticing some very slow perf when compiling medium complexity nested schemas. Are you interested in test cases for that as well?
The compilation slowness appears to be caused by liberal use of :merge. when I remove it and just compose maps (i.e. inline) I see compile speeds improve by 10x
I’ve worked around both the compilation (i.e. validator) and runtime perf issues so this is not urgent for me. I’ll be happy to provide more test cases if you need them
not urgent because I can work around the perf by not using recursion in my initial spec replacements. full recursion will be useful but can come later
and because OSS should never be urgent 🙂
I wonder if I/we could turn this into a useful sample for others to learn from? happy to do this if you agree it would be useful
have you considered using :fn without using sci? why is that not a good solution?
How does malli expect bytes?
to be delivered e.g. when you have a JSON api
as base64? (that would seem random)
or would one do a pass over the json, deserialize the base64 manually?
I'm asking this since babashka pods communicate via edn or json, which doesn't have a built-in way to represent bytes. transit does have it
@borkdude atm, there is no default encoding/decoding bytes and strings. Looking at OpenAPI docs, the guide is: > base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==
https://swagger.io/docs/specification/data-models/data-types/
for now I went with transit. it does it for me.. I should look into how it does it
so, there could be a byte<->string transformers in malli.transform
to make this a default
workaround….
(m/validator [:schema
{:registry {:person [:multi {:dispatch :person/gender}]}}
:person])