mirror of
https://github.com/metosin/reitit.git
synced 2025-12-25 19:28:26 +00:00
add specs
This commit is contained in:
parent
b54ee1a86b
commit
ed385afe5a
1 changed files with 5 additions and 1 deletions
|
|
@ -1,12 +1,16 @@
|
|||
(ns reitit.ring.middleware.alpha.muuntaja
|
||||
(:require [muuntaja.core :as m]
|
||||
[muuntaja.middleware]))
|
||||
[muuntaja.middleware]
|
||||
[clojure.spec.alpha :as s]))
|
||||
|
||||
(s/def ::muuntaja (partial instance? m/Muuntaja))
|
||||
|
||||
(defn create-format-middleware
|
||||
([]
|
||||
(create-format-middleware m/default-options))
|
||||
([options]
|
||||
{:name ::formats
|
||||
:spec (s/keys :opt-un [::muuntaja])
|
||||
:compile (fn [{:keys [muuntaja]} _]
|
||||
(let [options (or muuntaja options)]
|
||||
(if options
|
||||
|
|
|
|||
Loading…
Reference in a new issue