(->default-internal-swagger-ui-html config)Generate the html for swagger UI
Generate the html for swagger UI
(add-swagger-endpoints config)Takes the config and returns it with the swagger endpoints added
Takes the config and returns it with the swagger endpoints added
(routes->swagger-map routes & {route-opt-map :route-opt-map})Creates the json representation of the routes
Creates the json representation of the routes
(swagger-config? config)Checks if the config has the required keys for swagger functionality. Required keys:
Checks if the config has the required keys for swagger functionality. Required keys: * :xiana/swagger * :xiana/swagger-ui
(swagger-dot-json routes & {type :type route-opt-map :route-opt-map})Create swagger.json for all methods for each endpoint
Create swagger.json for all methods for each endpoint
(transform-endpoint [method
{{:keys [coercion no-doc swagger] :as data} :data
middleware :middleware
interceptors :interceptors}])(transform-path [path _ api-verb-map] router)Transform a path of a compiled route to swagger format.
Transform a path of a compiled route to swagger format.
(xiana-route->reitit-route [url opt-map & nested-routes :as route] all-methods)xiana-route->reitit-route is taking route entry of our custom shape of routes and transforms it into proper reitit route entry that is valid on the Swagger implemention of reitit.
(xiana-route->reitit-route ["/swagger-ui" {:action :swagger-ui :some-values true}]) ;; => ["/swagger-ui" {:get {:handler #function[clojure.core/identity], :action :swagger-ui}, :patch {:handler #function[clojure.core/identity], :action :swagger-ui}, :trace {:handler #function[clojure.core/identity], :action :swagger-ui}, :connect {:handler #function[clojure.core/identity], :action :swagger-ui}, :delete {:handler #function[clojure.core/identity], :action :swagger-ui}, :head {:handler #function[clojure.core/identity], :action :swagger-ui}, :post {:handler #function[clojure.core/identity], :action :swagger-ui}, :action :swagger-ui, :options {:handler #function[clojure.core/identity], :action :swagger-ui}, :put {:handler #function[clojure.core/identity], :action :swagger-ui}, :some-values true}]
xiana-route->reitit-route is taking route entry of our custom shape of routes
and transforms it into proper reitit route entry that is valid on the Swagger
implemention of reitit.
(xiana-route->reitit-route ["/swagger-ui" {:action :swagger-ui
:some-values true}])
;; => ["/swagger-ui"
{:get
{:handler #function[clojure.core/identity], :action :swagger-ui},
:patch
{:handler #function[clojure.core/identity], :action :swagger-ui},
:trace
{:handler #function[clojure.core/identity], :action :swagger-ui},
:connect
{:handler #function[clojure.core/identity], :action :swagger-ui},
:delete
{:handler #function[clojure.core/identity], :action :swagger-ui},
:head
{:handler #function[clojure.core/identity], :action :swagger-ui},
:post
{:handler #function[clojure.core/identity], :action :swagger-ui},
:action :swagger-ui,
:options
{:handler #function[clojure.core/identity], :action :swagger-ui},
:put
{:handler #function[clojure.core/identity], :action :swagger-ui},
:some-values true}]
(xiana-routes->reitit-routes routes all-methods)Transforms routes to the proper reitit form.
Transforms routes to the proper reitit form.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |