metosin / metosin/compojure-api

Add {:coercion :select-schema} option

Open
#448 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
1.1k
Forks
146
PR merge metrics
No merged PRs in 30d

Description

It would be incredibly handy to be able to filter out unwanted keys from an object based on the schema rather than reporting errors. I noticed the [select-schema](https://github.com/metosin/schema-tools/#select-schema ) function in schema-tools, but I'm not quite sure how to use that to create my own Coercion.

I might create a Coercion and submit a PR if someone can guide me in how to do it.

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 reading schema-tools' select-schema documentation and the repository's Coercion entry points. Determine how a :coercion :select-schema option should filter keys against the schema rather than report errors. Done means the option is available and its filtering behavior is covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.