Liking cljdoc? Tell your friends :D

xiana.swagger


->default-internal-swagger-ui-htmlclj

(->default-internal-swagger-ui-html config)

Generate the html for swagger UI

Generate the html for swagger UI
sourceraw docstring

add-swagger-endpointsclj

(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
sourceraw docstring

all-methodsclj

source

base-swagger-specclj

source

routes->swagger-mapclj

(routes->swagger-map routes & {route-opt-map :route-opt-map})

Creates the json representation of the routes

Creates the json representation of the routes 
sourceraw docstring

strip-top-level-keysclj

(strip-top-level-keys m)
source

swagger-config?clj

(swagger-config? config)

Checks if the config has the required keys for swagger functionality. Required keys:

  • :xiana/swagger
  • :xiana/swagger-ui
Checks if the config has the required keys for swagger functionality.
Required keys:
* :xiana/swagger
* :xiana/swagger-ui
sourceraw docstring

swagger-dot-jsonclj

(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
sourceraw docstring

swagger-json-endpoint-actionclj

(swagger-json-endpoint-action state)
source

swagger-pathclj

(swagger-path path opts)
source

transform-endpointclj

(transform-endpoint [method
                     {{:keys [coercion no-doc swagger] :as data} :data
                      middleware :middleware
                      interceptors :interceptors}])
source

transform-pathclj

(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.
sourceraw docstring

xiana-route->reitit-routeclj

(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}]
sourceraw docstring

xiana-routes->reitit-routesclj

(xiana-routes->reitit-routes routes all-methods)

Transforms routes to the proper reitit form.

Transforms routes to the proper reitit form.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close