reitit icon indicating copy to clipboard operation
reitit copied to clipboard

Support Swagger "examples"

Open Limess opened this issue 3 years ago • 1 comments

Add support for documenting curated swagger examples, see https://swagger.io/docs/specification/2-0/adding-examples/

The current schema driven data is excellent, but it'd be great to also support examples with sensible defaults and actual data, rather than just types.

Limess avatar Sep 10 '21 14:09 Limess

You can currently add any swagger data using :swagger key, either to route-data or to models. Example here: https://github.com/metosin/reitit/blob/master/examples/http-swagger/src/example/server.clj#L32-L37 & https://cljdoc.org/d/metosin/reitit/0.5.15/doc/ring/swagger-support

ikitommi avatar Sep 10 '21 16:09 ikitommi