diff --git a/modules/openapi-generator/src/main/resources/clojure/core.mustache b/modules/openapi-generator/src/main/resources/clojure/core.mustache index d55442603ae..4506eab9f22 100644 --- a/modules/openapi-generator/src/main/resources/clojure/core.mustache +++ b/modules/openapi-generator/src/main/resources/clojure/core.mustache @@ -24,6 +24,11 @@ "Dynamic API context to be applied in API calls." default-api-context) +(defn set-api-context + "Set the *api-context* globally" + [new-context] + (alter-var-root #'*api-context* (constantly (merge *api-context* new-context)))) + (defmacro with-api-context "A helper macro to wrap *api-context* with default values." [api-context & body] diff --git a/samples/client/petstore/clojure/src/open_api_petstore/core.clj b/samples/client/petstore/clojure/src/open_api_petstore/core.clj index 8dae9bb0f81..28993e8b0d6 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/core.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/core.clj @@ -24,6 +24,11 @@ "Dynamic API context to be applied in API calls." default-api-context) +(defn set-api-context + "Set the *api-context* globally" + [new-context] + (alter-var-root #'*api-context* (constantly (merge *api-context* new-context)))) + (defmacro with-api-context "A helper macro to wrap *api-context* with default values." [api-context & body]