Fork me on GitHub

The demo on ClojureD was schematized malli fn's emitting clj-kondo type definitions. I'll make a real impl out of that now with the clj-together funding. Not the first thing, but will most likely need help with that @borkdude, will poke you when about to do that. The second thing, which would be a nice experiment is if malli itself could be used inside clj-kondo to validate both malli data and schemas, e.g.

(do-it {:Type "AWS::AppSync::ApiKey"
        :Descriptionz "kikka"})
.. would emit clj-kondo errors:
{:ApiId ["missing required key"]
 :Descriptionz ["should be spelled :Description"]}


autocomplete-stuff: I don't know how to do those, and most likely don't have to study that, but happy to help on Malli side if someone want's to try that out


with the :multi dispatch key validation, it would yield:

(do-it {:Type "AWS::ApiGatway::UsagePlan"
        :Description "kikka"
        :UsagePlanName "kukka"}
.. would emit clj-kondo errors:
{:Type ["should be spelled \"AWS::ApiGateway::UsagePlan\""]}


@ikitommi I tried a similar thing using the type system in clj-kondo. It can be done, but it only works at places where literal maps are passed. So when you use assoc et al, it already breaks (although I think I have some logic which tries to account for that, it's been a while)


as an experiment, it'd be interesting what comes out of it

👍 3

I recently listened to a podcast with Tony Kay. He is working on something similar called GuardRails Pro which will be closed source


It would be great to have a free alternative


Looked up and listened the ClojureScript Podcast about GRP, sounds interesting.


Interesting times ahead, sounds like Clojure is getting mature :)


@jeroenvandijk small changes: • :dispatch is mandatory in :multi, e.g. can’t set via Schema creations opts => this makes it visible for error handling • malli.error/with-spell-checking now understands :multi dispatch values if the :dispatch value is a keyword


(-> (m/explain
      {:Type "AWS::AppSync::ApiKey"
       :Descriptionz "kikka"})
; loaded "AWS::AppSync::ApiKey"
; => {:ApiId ["missing required key"]
;     :Descriptionz ["should be spelled :Description"]}

(-> Schema
      {:Type "AWS::ApiGatway::UsagePlan"
       :Description "kikka"
       :UsagePlanName "kukka"})
; => {:Type ["did you mean AWS::ApiGateway::UsagePlan"]}


Wow, super nice. Thanks!