malli

https://github.com/metosin/malli :malli:
ikitommi 2020-11-01T15:26:31.383300Z

@hoppy https://github.com/metosin/malli/issues/87 help welcome!

2020-11-01T18:29:10.384200Z

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

borkdude 2020-11-01T18:54:43.384900Z

@lmergen Should enums always be keywords?

2020-11-01T18:57:32.386300Z

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

borkdude 2020-11-01T18:58:23.386700Z

right

ikitommi 2020-11-01T19:16:08.391300Z

@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

2020-11-01T19:16:54.391800Z

oh that works well enough for now

ikitommi 2020-11-01T19:19:43.395100Z

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.

ikitommi 2020-11-01T19:20:15.395700Z

(correct, but not practical)