schema 2017-11-08

@jerger has joined the channel

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

Nice tool 🙂

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)

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

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

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

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