metosin / metosin/compojure-api

expose route schemas for (test) clients

Open
#303 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.