does anyone know of any documentation/samples for customizing the examples provided with the swagger ui
nvm i managed to find it
you can use ‘describe’ to add swagger metadata to a schema
@nickmbailey where did you find that? just curious
just browsing around in the examples directory
specifically i noticed using ‘describe’ here: https://github.com/metosin/compojure-api/blob/master/examples/thingie/src/examples/thingie.clj#L58
so i looked that up and saw it merged swagger metadata with a schema object
so tried it out by doing (describe MySchema “blah” :example “json_string”)
and voila
what’s actually really awesome is that describe just adds clojure metadata so you can just put it in your defschema
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}