From 612685336a7265f820dc6dd362ef300adcbc1977 Mon Sep 17 00:00:00 2001 From: Ambrose Bonnaire-Sergeant Date: Mon, 8 Jul 2024 16:10:20 -0500 Subject: [PATCH] style + fix doc --- src/ring/swagger/json_schema.clj | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ring/swagger/json_schema.clj b/src/ring/swagger/json_schema.clj index b730a4ba..c54d8830 100644 --- a/src/ring/swagger/json_schema.clj +++ b/src/ring/swagger/json_schema.clj @@ -257,7 +257,7 @@ (defn properties "Take a map schema and turn them into json-schema properties. The result is put into collection of same type as input schema. - Thus linked/map should keep the order of items. Returnes nil + Thus linked/map should keep the order of items. Returns nil if no properties are found." [schema] {:pre [(common/plain-map? schema)]} @@ -265,11 +265,10 @@ (for [[k v] schema :when (s/specific-key? k) :let [key-meta (meta k) - k (s/explicit-schema-key k)] - :let [v (try->swagger v k key-meta)]] + k (s/explicit-schema-key k) + v (try->swagger v k key-meta)]] (and v [k v])))] - (if (seq props) - props))) + (not-empty props))) (defn additional-properties "Generates json-schema additional properties from a plain map