# metosin/compojure-api

Sweet web apis with Compojure & Swagger

Repository: https://github.com/metosin/compojure-api
Canonical: https://ross.abutalabs.com/products/compojure-api
Homepage: http://metosin.github.io/compojure-api/doc/
Language: Clojure
License: EPL-1.0
License Family: copyleft
Topics: clojure, rest, api, swagger, schema, openapi, http, ring, clojure-spec, async, metosin-stable
Last push: 2024-11-04T20:35:42+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4621, "days_push": 667, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1124, forks 146 (observed 2026-08-28T04:03:40.636795+00:00)

## What it is
A Clojure library that extends Compojure with tools for building REST web APIs, including Schema/clojure.spec data coercion and automatic Swagger/OpenAPI documentation. It bundles middleware for common API behaviors like exception handling and supports async handlers and multiple response formats.

## Use cases
- build a REST API in Clojure with automatic Swagger docs
- add request/response schema coercion to Compojure routes
- generate OpenAPI documentation for a Ring-based API
- serve JSON, EDN, and Transit responses from one API
- handle API exceptions and validation errors uniformly
- define bi-directional routes for a web service

## When to choose
- you are maintaining or extending an existing Compojure-based Clojure API
- you want Swagger/OpenAPI docs generated from route definitions
- you need Schema or clojure.spec coercion on API endpoints

## When to avoid
- you are starting a new Clojure project - the maintainers recommend reitit instead
- you need a framework outside the JVM/Clojure ecosystem
- you want a non-Ring web stack

## Facets
- artifact type: library
- maturity: maintenance
- function: web-framework, api-framework, routing, middleware, serialization, http-server
- domain: web-development, backend, apis, developer-tools
- platform: jvm, jvm-scripting
- tags: clojure, swagger, openapi, ring, compojure, schema-coercion, rest-apis

## Member repositories
- metosin/compojure-api (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:40.636795+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:39:50.361677+00:00, confidence not recorded.
  - readme: https://github.com/metosin/compojure-api (fetched 2026-08-28T04:03:40.636795+00:00, sha dc469f705bfd)
  - homepage: http://metosin.github.io/compojure-api/doc/ (fetched 2026-08-29T12:44:00.456761+00:00, sha 025a44640c5e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
