Description
Ring-Swagger is a Clojure library that generates Swagger 2.0 and OpenAPI 3.0 specifications for web apps built on Ring. It uses Plumatic Schema, with support for clojure.spec through spec-tools. The library turns deeply nested schemas into Swagger JSON Schema definitions, and it offers serialization and coercion for JSON and strings. Middleware handles schema validation errors and publishes the Swagger data. It also has a local API validator and can generate swagger.json through ring.swagger.swagger2/swagger-json. Swagger UI bindings are available, with the UI itself obtained separately as a jar or from NPM. Route definitions are plain Clojure maps defined by the schema contract, and extra keys are passed through, so any valid Swagger data can be included. The README gives examples for both specification versions and shows how to customize the output with an options map. It requires Java 11 or newer. Web libraries such as Compojure-Api and yada build on it.…
Highlights
- Swagger 2.0 and OpenAPI 3.0 spec generation
- Schemas from Plumatic Schema and clojure.spec
- Validation error middleware
- Local API validator
- Swagger UI bindings
Ratings & Reviews
No ratings yet
Be the first to rate Ring Swagger.
People also visit
Ring Swagger FAQ
What is Ring-Swagger?
A Clojure library that builds Swagger and OpenAPI specifications for Ring-based web apps from your route schemas.
Who is it for?
Clojure developers who want API documentation generated from their route definitions.
Which spec versions are supported?
Swagger 2.0 and OpenAPI 3.0. The README includes simple and more complete examples for both.
What does it need?
Java 11 or newer. The Swagger UI is obtained separately, as a jar or from NPM.
What are the best Ring Swagger alternatives?
Popular alternatives to Ring Swagger include Grape Swagger, Kin Openapi and Utoipa. See all Ring Swagger alternatives




