File tree 7 files changed +51
-7
lines changed
7 files changed +51
-7
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ bower_components
13
13
* .log
14
14
** /# *
15
15
. # *
16
+ gh-pages
Original file line number Diff line number Diff line change 2
2
3
3
[ Swagger] ( http://swagger.io/ ) implementation for Clojure/Ring using [ Prismatic Schema] ( https://github.com/Prismatic/schema ) for data modeling.
4
4
5
+ - [ API Docs] ( http://metosin.github.io/ring-swagger/doc/ )
5
6
- Supports both 1.2 and 2.0 Swagger Specs
6
7
- For web developers
7
8
- Extendable Schema-> ; JSON Mappings with out-of-the-box support for most common types
24
25
- [ Compojure-Api] ( https://github.com/metosin/compojure-api ) for Compojure
25
26
- [ fnhouse-swagger] ( https://github.com/metosin/fnhouse-swagger ) for fnhouse
26
27
- [ pedastal-swagger] ( https://github.com/frankiesardo/pedestal-swagger ) for Pedastal
28
+ - [ yada] ( https://github.com/juxt/yada )
27
29
28
30
Route definitions as expected as a clojure Map defined by the [ Schema] ( https://github.com/metosin/ring-swagger/blob/master/src/ring/swagger/swagger2_schema.clj ) . The Schema is open as ring-swagger tries not to be on your way - one can always pass any extra data in the Swagger Spec format.
29
31
Original file line number Diff line number Diff line change 18
18
[org.flatland/ordered " 1.5.2" ]]
19
19
:profiles {:dev {:plugins [[lein-clojars " 0.9.1" ]
20
20
[lein-ring " 0.9.4" ]
21
- [lein-midje " 3.1.3" ]]
21
+ [lein-midje " 3.1.3" ]
22
+ [funcool/codeina " 0.1.0" ]]
22
23
:dependencies [[midje " 1.7.0-SNAPSHOT" ]
23
24
[ring-mock " 0.1.5" ]
24
25
[metosin/scjsv " 0.2.0" ]
25
26
[metosin/ring-swagger-ui " 2.0.24" ]
26
27
[javax.servlet/servlet-api " 2.5" ]]}
27
28
:1.7 {:dependencies [[org.clojure/clojure " 1.7.0-alpha4" ]]}}
29
+ :codeina {:sources [" src" ]
30
+ :output-dir " gh-pages/doc"
31
+ :src-dir-uri " http://github.com/metosin/ring-swagger/blob/master/"
32
+ :src-linenum-anchor-prefix " L" }
28
33
:aliases {" all" [" with-profile" " dev:dev,1.7" ]
29
34
" test-ancient" [" midje" ]})
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ rev=$( git rev-parse HEAD)
4
+ remoteurl=$( git ls-remote --get-url origin)
5
+
6
+ git fetch
7
+ if [[ -z $( git branch -r --list origin/gh-pages) ]]; then
8
+ (
9
+ mkdir gh-pages
10
+ cd gh-pages
11
+ git init
12
+ git remote add origin ${remoteurl}
13
+ git checkout -b gh-pages
14
+ git commit --allow-empty -m " Init"
15
+ git push -u origin gh-pages
16
+ )
17
+ elif [[ ! -d gh-pages ]]; then
18
+ git clone --branch gh-pages ${remoteurl} gh-pages
19
+ else
20
+ (
21
+ cd gh-pages
22
+ git pull
23
+ )
24
+ fi
25
+
26
+ mkdir -p gh-pages/doc
27
+ lein doc
28
+ cd gh-pages
29
+ git add --all
30
+ git commit -m " Build docs from ${rev} ."
31
+ git push origin gh-pages
Original file line number Diff line number Diff line change 24
24
25
25
(defn extract-parameters
26
26
" Extract parameters from head of the list. Parameters can be:
27
- 1) a map (if followed by any form) [{:a 1 :b 2} :body] => {:a 1 :b 2}
28
- 2) list of keywords & values [:a 1 :b 2 :body] => {:a 1 :b 2}
29
- 3) else => {}
27
+
28
+ 1. a map (if followed by any form) `[{:a 1 :b 2} :body]` => `{:a 1 :b 2}`
29
+ 2. list of keywords & values `[:a 1 :b 2 :body]` => `{:a 1 :b 2}`
30
+ 3. else => `{}`
31
+
30
32
Returns a tuple with parameters and body without the parameters"
31
33
[c]
32
34
{:pre [(sequential? c)]}
Original file line number Diff line number Diff line change 1
1
(ns ring.swagger.json-schema-dirty
2
+ " Json-type multimethod implementations for some Schemas which can't be
3
+ properly described using Json Schema."
2
4
(:require [ring.swagger.json-schema :refer :all ]))
3
5
4
6
(defmethod json-type schema.core.ConditionalSchema [e]
Original file line number Diff line number Diff line change 25
25
default is to serve swagger-ui at \" /\" .
26
26
27
27
Other options can be given using keyword-value pairs.
28
- :root - the root prefix to get resources from. Default 'swagger-ui'
29
- :swagger-docs - the endpoint to get swagger data from. Default '/swagger.json'
30
- :oauth2 - map with oauth2 params, namely :client-id, :realm and :app-name"
28
+
29
+ - **:root** the root prefix to get resources from. Default 'swagger-ui'
30
+ - **:swagger-docs** the endpoint to get swagger data from. Default '/swagger.json'
31
+ - **:oauth2** map with oauth2 params, namely `:client-id`, `:realm` and `:app-name`"
31
32
[& params]
32
33
(let [[path kvs] (if (string? (first params))
33
34
[(first params) (rest params)]
You can’t perform that action at this time.
0 commit comments