mirror of
https://github.com/metosin/reitit.git
synced 2025-12-20 09:31:11 +00:00
best-effort to retain route order with swagger
This commit is contained in:
parent
684f5bbb29
commit
5713afac34
1 changed files with 2 additions and 1 deletions
|
|
@ -98,7 +98,8 @@
|
|||
transform-path (fn [[p _ c]]
|
||||
(if-let [endpoint (some->> c (keep transform-endpoint) (seq) (into {}))]
|
||||
[(swagger-path p) endpoint]))]
|
||||
(let [paths (->> router (r/compiled-routes) (filter accept-route) (map transform-path) (into {}))]
|
||||
(let [map-in-order #(->> % (apply concat) (apply array-map))
|
||||
paths (->> router (r/compiled-routes) (filter accept-route) (map transform-path) map-in-order)]
|
||||
{:status 200
|
||||
:body (meta-merge swagger {:paths paths})})))
|
||||
([req res raise]
|
||||
|
|
|
|||
Loading…
Reference in a new issue