malli

https://github.com/metosin/malli :malli:
steveb8n 2020-07-07T01:07:03.079400Z

@ikitommi sample repo up and running: https://github.com/stevebuik/fork-malli-ideas

steveb8n 2020-07-07T01:07:36.080200Z

first question to come from it: can the fast validation i.e. m/validator be used with m/explain?

steveb8n 2020-07-07T04:50:40.081Z

and what was the “nested data” problem you had with this integration? maybe it’s another good demo in this repo

jkent 2020-07-07T13:57:09.083100Z

does malli support default error messages for enums? I’m getting "message": "unknown error" unless I do something like this for each enum:

(def source-system
  [:enum
   {:error/message "should be either: foo|bar"
    :swagger/type  "string"
    :description   "source system from where the request comes in"}
   "foo" "bar"])

ikitommi 2020-07-07T20:37:01.084600Z

@jkent the default errors are defined in https://github.com/metosin/malli/blob/master/src/malli/error.cljc. There is no default for :enum, but could be. PR welcome!

ikitommi 2020-07-07T20:38:31.086200Z

also, if some more native english-writing person could check the spelling of the default errors, should should be int be should be an int etc…

ikitommi 2020-07-07T21:03:01.089300Z

@steveb8n just trying to update a value in path like [:user :address :street] , I recall it expected string paths and didn't support nesting. Might have been just user error.

steveb8n 2020-07-07T22:51:18.090800Z

@ikitommi I think that is correct. it appears to insist on a flat values map, with string keys. in re-frame that’s easy with a sub. elsewhere it could be harder