4646 * ` context* ` => ` context `
4747 * ` defroutes* ` => ` defroutes `
4848
49- * ** BREAKING** ` public-resource-routes ` & ` public-resources ` are removed from ` compojure.api.middleware ` .
49+ * ** BREAKING** ` swagger-docs ` and ` swagger-ui ` are now longer in ` compojure.api.sweet `
50+ * Syntax was hairy and when configuring the spec-url it needed to be set to both in order to work
51+ * In future, there are multiple ways of setting the swagger stuff:
52+ * via api-options ` :swagger ` (has no defaults)
53+ * via ` swagger-routes ` function, mounting both the ` swagger-ui ` and ` swagger-docs ` and wiring them together
54+ * by default, mounts the swagger-ui to ` / ` and the swagger-spec to ` /swagger.json `
55+ * via the old ` swagger-ui ` & ` swagger-docs ` (need to be separately imported from ` compojure.api.swagger ` ).
56+ * see https://github.com/metosin/compojure-api/wiki/Swagger-integration for details
57+
58+ ``` clj
59+ (defapi app
60+ (swagger-routes )
61+ (GET " /ping" []
62+ (ok {:message " pong" })))
63+
64+ (defapi app
65+ {:swagger {:ui " /" , :spec " /swagger.json" }}
66+ (GET " /ping" []
67+ (ok {:message " pong" })))
68+ ```
5069
5170* ** BREAKING** : api-level coercion option is now a function of ` request => type => matcher ` as it is documented.
5271Previously required a ` type => matcher ` map. Options are checked against ` type => matcher ` coercion input, and a
@@ -70,6 +89,8 @@ take a vector of middleware containing either
7089has been renamed to ` :swagger ` .
7190 * will break at macro-expansion time with helpful exception
7291
92+ * ** BREAKING** ` public-resource-routes ` & ` public-resources ` are removed from ` compojure.api.middleware ` .
93+
7394* ** BREAKING** : ` compojure.api.legacy ` namespace has been removed.
7495
7596### Migration guide
@@ -84,8 +105,6 @@ https://github.com/metosin/compojure-api/wiki/Migration-Guide-to-1.0.0
84105
85106* top-level ` api ` is now just function, not a macro. It takes an optional options maps and a top-level route function.
86107
87- * ` swagger-docs ` and ` swagger-ui ` are now functions instead of macros.
88-
89108* Coercer cache is now at api-level with 10000 entries.
90109
91110* Code generated from restructured route macros is much cleaner now
0 commit comments