A Clojure library for building web APIs with automatic Swagger documentation, data validation, and async support.
Compojure-api is a Clojure library built on top of Compojure that provides tools for creating web APIs with built-in Swagger documentation, data validation, and asynchronous support. It solves the problem of manually documenting APIs and handling data coercion by automating these tasks through a concise route DSL.
Clojure developers building RESTful web services who want automatic API documentation, strong data validation, and async capabilities without extensive boilerplate.
Developers choose Compojure-api for its seamless integration with Swagger for documentation, support for both Schema and clojure.spec for validation, and its extensible, data-driven approach to API design, all while leveraging the familiar Compojure routing syntax.
Sweet web apis with Compojure & Swagger
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates OpenAPI specs and UI automatically from route definitions, eliminating manual documentation work, as shown in the examples with /api-docs endpoints.
Integrates Schema and clojure.spec for input/output coercion, ensuring type safety and reducing errors, supported since version 2.0.0.
Enables non-blocking operations with manifold and core.async, allowing for efficient I/O, as demonstrated in the async hello-world examples.
Supports client-negotiable formats like JSON, EDN, Transit, YAML, and MessagePack, increasing API flexibility without extra configuration.
Allows custom metadata handlers to extend the DSL, providing flexibility for advanced use cases, as noted in the wiki.
The README's recommendation to use reitit for new projects suggests reduced active development, potentially making it a legacy choice.
Bundles several libraries (Compojure, ring-swagger, etc.), which can complicate setup, debugging, and increase attack surface.
Lacks built-in support for WebSockets or GraphQL, requiring additional libraries and integration effort for modern real-time APIs.
Relies on a wiki and separate API docs, which can be outdated or hard to navigate compared to centralized documentation.