ring-swagger 2019-03-15

@dave.dixon has joined the channel

Using compojure-api 2.0.0-alpha29. The swagger UI shows several options for content type, but switching from application/json does not change the examples to match the format. Is there a way to make this work? If not, how do I restrict content type to be only json?

@dave.dixon swagger formats are configurable like so:

(c/api
  {:swagger {,,,
          :data {,,,
                 :produces ["application/transit+json" "application/json" "application/edn"]
                 :consumes ["application/json" "application/edn" "application/transit+json"]}}} ,,,)
I don't recall it ever had any effect on the examples in UI.

Thanks, that did the trick. The UI here changes the example when content type is changed: http://petstore.swagger.io/#/pet/addPet

🤔 1

are you using swagger3/openapi v3?

Whatever the latest compojure-api does.