metosin / metosin/schema-tools
Support recursive in get-in
- Dominant language
- Clojure
- Stars
- 110
- Forks
- 15
- Avg merge
- 6m
- Merged PRs (30d)
- 1
Description
Hi,
it seems recursive is not supported by get-in. Was it omitted on purpose?
With small modifications it works for my use case:
```
(defn- unwrap-recursive [m]
(cond
(recursive? m) (deref (:derefable m)) ; probably use schema-value
:else m))
```
```
(defn- get-in-schema [m k & [default]]
(unwrap-recursive (unwrap-sequence-schemas (get m (key-in-schema m k) default))))
```
Contributor guide
Research direction
Start by tracing the existing get-in behavior and the shown get-in-schema, unwrap-recursive, and unwrap-sequence-schemas functions. Read how recursive?, :derefable, and schema-value are handled elsewhere in the project. Done means get-in supports recursive schemas consistently with the existing schema unwrapping behavior, with coverage for the reported use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100