File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 494
494
:type " void" }]
495
495
:path " /user" }]})))
496
496
497
+
498
+ (facts " swagger-docs with Return and Body models"
499
+ (defapi api
500
+ (swagger-docs )
501
+ (swaggered +name+
502
+ (POST* " /echo" []
503
+ :return {:a String}
504
+ :body [_ {:a String}]
505
+ identity)))
506
+
507
+ (fact " api-docs"
508
+ (let [[status body] (get* api (str " /api/api-docs/" +name+) {})]
509
+
510
+ (fact " are found"
511
+ status => 200 )
512
+
513
+ (let [operation (-> body :apis first :operations first)
514
+ body-parameter-type (-> operation :parameters first :type keyword)
515
+ return-type (-> operation :type keyword)]
516
+
517
+ (fact " generated body-param is found in Models"
518
+ body-parameter-type => truthy
519
+ (-> body :models body-parameter-type) => truthy)
520
+
521
+ (fact " generated return-param is found in Models"
522
+ return-type => truthy
523
+ (-> body :models return-type) => truthy)))))
524
+
497
525
(fact " swagger-docs works with the :middlewares"
498
526
(defapi api
499
527
(swagger-docs )
Original file line number Diff line number Diff line change 2
2
(:require [compojure.api.core :refer :all ]
3
3
[compojure.api.swagger :refer :all ]
4
4
[compojure.core :refer :all ]
5
- [midje.sweet :refer :all ]))
5
+ [midje.sweet :refer :all ]
6
+ [schema.core :as s]))
6
7
7
8
(fact " extracting compojure paths"
8
9
You can’t perform that action at this time.
0 commit comments