Fork me on GitHub
#ring-swagger
<
2017-10-25
>
nickmbailey15:10:59

does anyone know of any documentation/samples for customizing the examples provided with the swagger ui

nickmbailey16:10:56

nvm i managed to find it

nickmbailey16:10:13

you can use ‘describe’ to add swagger metadata to a schema

nha16:10:18

@nickmbailey where did you find that? just curious

nickmbailey16:10:18

just browsing around in the examples directory

nickmbailey16:10:58

so i looked that up and saw it merged swagger metadata with a schema object

nickmbailey17:10:28

so tried it out by doing (describe MySchema “blah” :example “json_string”)

nickmbailey17:10:42

what’s actually really awesome is that describe just adds clojure metadata so you can just put it in your defschema

ikitommi17:10:53

Spec sample:

(jsc/transform
  (st/spec
    {:spec integer?
     :name "integer"
     :description "it's an int"
     :json-schema/default 42}))
; {:type "integer"
;  :title "integer"
;  :description "it's an int"
;  :default 42}