schema

jerger 2017-11-08T08:09:46.000348Z

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

ikitommi 2017-11-08T16:07:27.000200Z

does https://github.com/metosin/schema-viz help?

jerger 2017-11-08T17:34:53.000437Z

Nice tool 🙂

jerger 2017-11-08T17:35:44.000681Z

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)

ikitommi 2017-11-08T18:17:22.000206Z

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

ikitommi 2017-11-08T18:19:47.000015Z

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

jerger 2017-11-08T18:33:51.000078Z

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

jerger 2017-11-08T18:37:43.000326Z

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