mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
.
This commit is contained in:
parent
5829e1c656
commit
dba8d159cc
1 changed files with 4 additions and 3 deletions
|
|
@ -78,14 +78,15 @@
|
|||
;; on the coercion?
|
||||
;; NOTE: Re-creates coercer on every call, could this be pre-compiled somewhere
|
||||
;; or memoized? Does it matter much?
|
||||
;; TODO: query-coercer could be compiled in reitit.frontend/router, same as request coercers.
|
||||
(str "?" (let [coercion (-> match :data :coercion)
|
||||
schema (when coercion
|
||||
(coercion/-compile-model coercion (-> match :data :parameters :query) nil))
|
||||
coercer (when (and schema coercion)
|
||||
(coercion/-query-string-coercer coercion schema))
|
||||
query-params (or (when coercer
|
||||
(coercer query-params :default))
|
||||
query-params)]
|
||||
query-params (if coercer
|
||||
(coercer query-params :default)
|
||||
query-params)]
|
||||
;; Default encoding for values will handle values that aren't encoded using coercer
|
||||
(impl/query-string query-params)))))))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue