metosin / metosin/compojure-api
expose route schemas for (test) clients
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 1.1k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
Currently there is an API which coerces a response to the json content. It would be useful for testing if the reverse mapping is also provided by default.
Example:
```clojure
(deftext something-to-test
(let [entity (generate schema)
_ (db/insert! entity)
response (app request)]
(is (ok? response))
(when (ok? response) (is (= (-> response (->schema-entity schema)) entity)))))
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing API that coerces a response to JSON and trace how route schemas are handled. Use the issue's example as the target behavior; the work is done when the reverse mapping is available by default for test clients and the demonstrated schema/entity comparison can pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- api, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100