From 39aafc902986c8ab394b85f60e2e30297430e469 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Sat, 16 May 2020 14:08:16 +0300 Subject: [PATCH] Fix malli + swagger --- CHANGELOG.md | 4 ++++ modules/reitit-malli/src/reitit/coercion/malli.cljc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 336721c0..e21f2d60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,10 @@ is called the first time, so that `rfe/push-state` and such can be called * lots of bug fixes, see [spec-tools changelog](https://github.com/metosin/spec-tools/blob/master/CHANGELOG.md#0102-2020-05-05) +### `reitit-malli` + +* Swagger body-parameters don't use empty default, fixes [#399](https://github.com/metosin/reitit/issues/399) + ### `reitit-sieppari` * changes from Sieppari: diff --git a/modules/reitit-malli/src/reitit/coercion/malli.cljc b/modules/reitit-malli/src/reitit/coercion/malli.cljc index 45124991..3e57ef28 100644 --- a/modules/reitit-malli/src/reitit/coercion/malli.cljc +++ b/modules/reitit-malli/src/reitit/coercion/malli.cljc @@ -80,7 +80,7 @@ (defmethod extract-parameter :body [_ schema options] (let [swagger-schema (swagger/transform schema (merge options {:in :body, :type :parameter}))] [{:in "body" - :name (:title swagger-schema "") + :name (:title swagger-schema "body") :description (:description swagger-schema "") :required (not= :maybe (m/name schema)) :schema swagger-schema}]))