Fork me on GitHub
#malli
<
2020-11-01
>
lmergen18:11:10

is it correct that (at least currently), transforming enums from json does not yet correctly transform them to keywords if necessary ?

borkdude18:11:43

@lmergen Should enums always be keywords?

lmergen18:11:32

well I wouldn’t say always — but at least I would expect it to convert it if that leads to a valid enum value

ikitommi19:11:08

@lmergen right. There is no type inferrer with enums. They could be anything [:enum 1 "2" :3 '4]. If you know the type, you can hint it: [:and keyword? [:enum :a :b :c]] and they transform correctly

lmergen19:11:54

oh that works well enough for now

ikitommi19:11:43

the generated JSON Schema with :and is bit off, it creates :allOf out of that. Should merge the results instead if there is just one district :type found.

ikitommi19:11:15

(correct, but not practical)