Fork me on GitHub
#malli
<
2022-10-05
>
DenisMc08:10:01

Quick question about malli with swagger. Right now, I define my reitit route definitions with malli, and malli-swagger generates the swagger definitions - all working well. However, recently I have added a couple of API responses where the malli definition is of the form [:or [<option1 payload>] [<option 2 payload>]] In this case, swagger seems to just report <option 1 payload> as the route payload. How would I go about updating swagger so that it displays the options to the API user? Thanks in advance.

DenisMc22:10:58

I’ll give it a go 👍

dangercoder20:10:30

Does anyone know an idiomatic way of making malli always generate UTF8 strings? I currently use my own :utf8-string type instead of :string

Noah Bogart20:10:04

When is it not generating utf-8 strings?

dangercoder20:10:08

(malli.generator/generate [:string {:min 10}])

dangercoder20:10:26

adding :min makes the generator not generate utf-8 strings consistently

👍 1
dangercoder11:10:36

https://github.com/metosin/malli/issues/758 Would be great if someone else could try it out and see if you get the same results

ambrosebs15:10:22

I was the last person to touch that code so I should try it out...do you know how long this has happened and if there is a better generator to use?

ambrosebs15:10:56

looks like this case is built on gen/char .

ambrosebs15:10:36

perhaps gen/char-ascii or gen/char-alphanumeric should be used.

dangercoder17:10:54

Thanks for the fix :heart_hands:

👍 1