Fork me on GitHub
#malli
<
2020-04-20
>
eskos06:04:22

:and requires two leaves, you have only one.

eskos06:04:06

@ikitommi What would be your preferred media for discussing some design choices malli could potentially have a stake in? I’ve been thinking for quite a while that there’s two topics I’d like to have persistently discussed, decided and documented, namely the plumbing&porcelain concept for schemas themselves I’ve mentioned before and swagger2 vs openapi3 vs postman collections generation, and while we could discuss those things here, the ephemeral nature of Slack and this unpaid Clojurians Slack instance especially isn’t very good documentation wise… 🙂

aisamu14:04:47

I'll just chime in to mention that some folks here (#data-science IIRC) have been using Zulip for that with apparent success! Doesn't lose history and has a much better (i.e. usable) threading model

teodorlu15:04:07

Second chime in: I've been using Zulip quite a bit, and I think I prefer it to Slack. I don't see a huge difference, but it would be possible to have a single malli channel with different topics, where design could be one.

aisamu15:04:22

Yup! I actually consume this slack's content through Zulip's mirror.

teodorlu15:04:57

Huh, cool. Didn't know that was possible. Do you happen to have a link?

aisamu15:04:29

Sure! https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/malli Each one of slack-archive's topics is a channel (after you invite @UFNE73UF4, that is)

👍 4
eskos15:04:27

Looks like Zulip’s free tier has limited search, are you sure it’s not going to lose history?

eskos15:04:41

Or is someone paying/hosting that? 🙂 Sorry, not familiar with Zulip’s hosting scheme…

aisamu15:04:59

> Zulip Cloud Standard is free for open source projects! 🎉

eskos06:04:24

@ikitommi that could maybe actually work for Metosin’s OSS? --^

eval202010:04:56

Zulip-admin here. We're indeed using Zulip's OSS-plan (https://www.zulipchat.com/for/open-source/) Happy to answer any more questions.

eval202010:04:38

btw I see @UFNE73UF4 is no longer a member of this channel... :thinking_face:

eval202010:04:19

scratch that (bots don’t appear in the member-list)

teodorlu14:04:16

Thanks for keeping Zulip working 🙂 It's been really helpful for doing Scicloj-work 💯

eval202014:04:28

yw!, great to hear.

plexus08:04:11

late to the thread here but I'd like to propose ClojureVerse for this. Long form asynchronous is more suitable for writing out proposals and discussing their merit. Happy to set up a Malli category.

👍 4
aisamu12:04:58

Worth noting that Zulip also favours long form, async content (with proper quoting, nesting, etc) given the threading model. (And I also consume ClojureVerse through Zulip's mirror - annoucements, but still) simple_smile

ikitommi10:04:53

oh, what would the category mean? all the discussion still go to the main feed?

ikitommi10:04:31

But, as the discussions are anyway in threads in clojureverse, one could just not read the malli thread/s if that’s not relevant to them.

teodorlu07:04:53

Thanks for the reference!

ikitommi06:04:39

@roklenarcic @suomi.esko there are two ways that the properties are used: 1. top-down: generators use this. the first generator that is found is used. [:and {:gen/elements ["a" "b" "c"], :error/message "fail"} string?] short-circuits on that gen. decoders & encoders compose top-down, json-schema overrides work this way etc. 2. after-the-fact: error messages are looked for after the error has happened. here: it the example, the failure happens at string? , which doesn’t know any of the parent decorations for errors. this is bad, and should be fixed in a coherent way, related issues: https://github.com/metosin/malli/issues/120 & https://github.com/metosin/malli/issues/86

ikitommi06:04:09

the error message thing could be “easily” fixed so that the error message formatter looks also at the parent schemas (all the information is available in malli.core/explain result.

ikitommi06:04:00

… but would not solve [:map [:x {:error/message "fail"} string?]]], where the info is in the entry meta.

ikitommi06:04:49

ideas welcome, will put my hammock on the backyard this week, so will think about how to do this

ikitommi06:04:51

@suomi.esko maybe a open malli video chat? google hangouts for example later this week? issues have persistent discussion, but as things link, the discussion is bit scattered.

eskos07:04:18

Hmm, video chat could probably be an interesting way to solve this, as I have no idea if this is like 5, 15 or 50 minute topic and it’s not quite clear to myself either entirely what the whole scope is…

ikitommi20:04:58

(def Country
  [:map {:id "Country"}
   [:name [:enum :FI :PO]]
   [:neighbors any?]])

(def Burger
  [:map {:id "Burger"}
   [:name string?]
   [:description {:optional true} string?]
   [:origin [:maybe [:maybe Country]]]
   [:price pos-int?]])

(def OrderLine
  [:map {:id "OrderLine"}
   [:burger Burger]
   [:amount int?]])

(def Order
  [:map {:id "Order"}
   [:lines [:vector OrderLine]]
   [:delivery [:map
               [:delivered boolean?]
               [:address [:map
                          [:street string?]
                          [:zip int?]
                          [:country Country]]]]]])

ikitommi20:04:48

(require '[malli.mermaid :as mermaid])

(mermaid/class-diagram Order)
;"classDiagram
;   class Country {
;     + :name [:enum :FI :PO]
;     + :neighbors any?
;   }
;   class Burger {
;     + :name string?
;     + :description string?
;     + :origin Country
;     + :price pos-int?
;   }
;   Burger o-- Country
;   class OrderLine {
;     + :burger Burger
;     + :amount int?
;   }
;   OrderLine o-- Burger
;   class OrderDeliveryAddress {
;     <<embedded>>
;     + :street string?
;     + :zip int?
;     + :country Country
;   }
;   OrderDeliveryAddress o-- Country
;   class OrderDelivery {
;     <<embedded>>
;     + :delivered boolean?
;     + :address OrderDeliveryAddress
;   }
;   OrderDelivery *-- OrderDeliveryAddress
;   class Order {
;     + :lines OrderLine
;     + :delivery OrderDelivery
;   }
;   Order o-- OrderLine
;   Order *-- OrderDelivery"

ikitommi20:04:29

(59 loc 😉)

kwrooijen22:04:50

Wow that's awesome

kwrooijen22:04:35

The tree structure logic is the mermaid namespace, right? I think it could be useful to have generic function to generate a dependency tree