From e740c7b3b0e8c1cfe472c4a075b5a57d5ea4b59b Mon Sep 17 00:00:00 2001 From: Ambrose Bonnaire-Sergeant Date: Mon, 22 Apr 2024 14:01:06 -0500 Subject: [PATCH] confs --- src/compojure/api/meta.clj | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/compojure/api/meta.clj b/src/compojure/api/meta.clj index 6f7bb0e5..19398026 100644 --- a/src/compojure/api/meta.clj +++ b/src/compojure/api/meta.clj @@ -948,15 +948,22 @@ bindings?)) "A context cannot be :static and also provide bindings. Either push bindings into endpoints or remove :static.") - configured-dynamic? (-> info :public :dynamic) + configured-dynamic? (or (-> info :public :dynamic) + (true? (get-in (meta *ns*) [:metosin/compojure-api :dynamic-contexts])) + (contains? + (some-> (System/getProperty "compojure.api.meta.dynamic-context-namespaces") + edn/read-string + set) + (ns-name *ns*))) configured-static? (or (-> info :public :static) (when-not configured-dynamic? - (contains? - (some-> (System/getProperty "compojure.api.meta.static-context-namespaces") - edn/read-string - set) - (ns-name *ns*)))) + (or (true? (get-in (meta *ns*) [:metosin/compojure-api :static-contexts])) + (contains? + (some-> (System/getProperty "compojure.api.meta.static-context-namespaces") + edn/read-string + set) + (ns-name *ns*))))) static? (or configured-static? (and (not configured-dynamic?)