Fork me on GitHub
#ring-swagger
<
2019-04-03
>
Michel A.15:04:37

Hi guys, I’m new using compojure-api and really like it. I’m using it with clojure-spec. I’m trying to customize the examples to be displayed in swagger from the api definition but is this possible (as in https://swagger.io/docs/specification/adding-examples/) ? Thanks

mping16:04:55

@michel_apostolou you can use

(s/def ::events
  (st/spec {:spec   (s/coll-of ::utils.time/local-date)) :json-schema/default ["2019-02-27"]})

mping16:04:10

basically pass json-schema/default to spec-tools spec builder

Michel A.16:04:36

@mping thank you for your prompt reply!! I had completely missed the whole spec-tools project

Michel A.16:04:47

this works very well!