Coax
Coax is an OpenAPI routing Clojure library to generate and route REST API via
canonical OpenAPI file.
The OpenAPI REST API definition format has become a standard in REST API
development.
In the past, the REST API may be completely defined in the OpenAPI definition
file(s), but the HTTP method/endpoint routing has been done independently of
the OpenAPI definition file(s) which may result in the actual routing of the
REST API becoming out-of-sync with the OpenAPI definition/document file(s).
Coax is a library that allows for Clojure REST API development that never is
out-of-sync with the OpenAPI definition/documentation file(s) by adding a
single `handler` key in the endpoint/method definition that links the
endpoint/method to a Clojure handler function identifier.
How to Use Coax
- Add `coax` dependency to the Compojure-based project.
- Define the REST API in OpenAPI file(s) with examples and response/request
schemas somewhere in the `resources` folder
(e.g. `resources/private/api/openapi.v1.json`)
- Add `handler` function identifiers as strings
(`package.subp1.subp2.handler.function-name`)in the OpenAPI file(s).
- In the initialization of your project, make call(s) to
`coax/import-openapi-definition-file`with the `resource` path as the string
argument.
- Add `(coax/api-compojure-route)` in your routes.
- Start your Compojure service.
- Use `curl` or another REST client and test your REST API handlers defined
in the OpenAPI file(s).
Source Repository and README.md
The `coax` git repository is
here.
API Documentation
TBD: The Clojure API documentation is
here.