Skip to content

Commit

Permalink
refactor: use update-vals
Browse files Browse the repository at this point in the history
  • Loading branch information
opqdonut committed Sep 1, 2023
1 parent df5f75e commit 497da67
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions modules/reitit-swagger/src/reitit/swagger.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,8 @@
(for [[_path path-data] paths
[_method data] path-data]
(:definitions data)))
paths-without-definitions (into {}
(for [[path path-data] paths]
[path (into {}
(for [[method data] path-data]
[method (dissoc data :definitions)]))]))]
paths-without-definitions (update-vals paths (fn [methods]
(update-vals methods #(dissoc % :definitions))))]
{:status 200
:body (meta-merge swagger {:paths paths-without-definitions :definitions definitions})}))
([req res raise]
Expand Down

0 comments on commit 497da67

Please sign in to comment.