We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a9c4cf commit 07738e0Copy full SHA for 07738e0
1 file changed
test/compojure/api/swagger_test.clj
@@ -170,3 +170,18 @@
170
:path-params [foo :- String]
171
identity))
172
=> {"/:foo.json" {:get {:parameters {:path {:foo String}}}}})
173
+
174
+(facts
175
+ (tabular
176
+ (fact "swagger-routes basePath can be changed"
177
+ (let [app (api (swagger-routes ?given-options))]
178
+ (->
179
+ (get* app "/swagger.json")
180
+ (nth 1)
181
+ :basePath)
182
+ => ?expected-base-path
183
+ (nth (raw-get* app "/conf.js") 1) => (str "window.API_CONF = {\"url\":\"" ?expected-swagger-docs-path "\"};")))
184
+ ?given-options ?expected-swagger-docs-path ?expected-base-path
185
+ {} "/swagger.json" "/"
186
+ {:data {:basePath "/app"}} "/app/swagger.json" "/app"
187
+ {:data {:basePath "/app"} :options {:ui {:swagger-docs "/imaginary.json"}}} "/imaginary.json" "/app"))
0 commit comments