ring-swagger

ring-swagger & compojure-api
Michel A. 2019-04-03T15:55:37.087Z

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

2019-04-03T16:20:55.087900Z

@michel_apostolou you can use

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

2019-04-03T16:21:10.088300Z

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

Michel A. 2019-04-03T16:32:36.089200Z

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

Michel A. 2019-04-03T16:32:47.089500Z

this works very well!