Fork me on GitHub
#schema
<
2017-11-08
>
jerger08:11:46

I'm searching for a way to generate documentation out of my defined schema. Is there a good way to achieve this?

jerger17:11:53

Nice tool 🙂

jerger17:11:44

But I'm looking for a way to add some additional information to required- or optional-keys. Intended doc may look like:

(def ServerTestConfig {
 (optional-key :netcat-test)
 {Keyword {:reachable? Bool}},          ; keyword is used to match test against fact
 (optional-key :netcat-fact)            ; parsed result of "nc [host] -w [timeout] && echo $?"
 {Keyword {:port Num,
           :host Str,                   ; may be ip or fqdn
           :timeout Num}},              ; timeout given in seconds
 (optional-key :netstat-test)

ikitommi18:11:22

You can add meta-data to maps, s/defschema already adds :name and :ns. Same applies to all Schema Records.

ikitommi18:11:47

there are some tools in metosin/schema-tools for attaching docs, contribute also to generated swagger-docs etc.

jerger18:11:51

How can I attach documentation to lets say (optional-key :netcat-test) ?

jerger18:11:43

Schematools I know. If I'm right there are map-walkes, utils for sub-schema selection - but regarding documentation I found nothing ?!