Skip to content

Commit

Permalink
Undo coercion related merge of params
Browse files Browse the repository at this point in the history
  • Loading branch information
agigao committed Sep 13, 2023
1 parent 6f25ec4 commit 8271f7b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/xiana/interceptor.clj
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,16 @@
(not-empty (get-in state [:request :multipart-params]))
(not-empty (get-in state [:request :body-params])))
method (get-in state [:request :request-method])
schemas (or (get-in state [:request-data :match :data method :parameters])
(get-in state [:request-data :match :data :parameters]))
cc (cond
(:path schemas) (valid? (:path schemas) path)
(:query schemas) (valid? (:query schemas) query)
(:form schemas) (valid? (:form schemas) form-params))]

schemas (merge (get-in state [:request-data :match :data :parameters])
(get-in state [:request-data :match :data method :parameters]))
cc (cond-> {}
(:path schemas)
(assoc :path (valid? (:path schemas) path))

(:query schemas)
(assoc :query (valid? (:query schemas) query))

(:form schemas)
(assoc :form (valid? (:form schemas) form-params)))]
(update-in state [:request :params] merge cc))))})

0 comments on commit 8271f7b

Please sign in to comment.