diff --git a/src/compojure/api/coercion.clj b/src/compojure/api/coercion.clj index 0dd26b04..c891383d 100644 --- a/src/compojure/api/coercion.clj +++ b/src/compojure/api/coercion.clj @@ -4,8 +4,8 @@ [compojure.api.request :as request] [compojure.api.coercion.core :as cc] ;; side effects - compojure.api.coercion.register-schema - compojure.api.coercion.register-spec) + compojure.api.coercion.schema + compojure.api.coercion.spec) (:import (compojure.api.coercion.core CoercionError))) (def default-coercion :schema) diff --git a/src/compojure/api/coercion/register_schema.clj b/src/compojure/api/coercion/register_schema.clj deleted file mode 100644 index e1e8f993..00000000 --- a/src/compojure/api/coercion/register_schema.clj +++ /dev/null @@ -1,8 +0,0 @@ -(ns compojure.api.coercion.register-schema - (:require [compojure.api.coercion.core :as cc])) - -(defmethod cc/named-coercion :schema [_] - (deref - (or (resolve 'compojure.api.coercion.schema/default-coercion) - (do (require 'compojure.api.coercion.schema) - (resolve 'compojure.api.coercion.schema/default-coercion))))) diff --git a/src/compojure/api/coercion/register_spec.clj b/src/compojure/api/coercion/register_spec.clj deleted file mode 100644 index 143320fb..00000000 --- a/src/compojure/api/coercion/register_spec.clj +++ /dev/null @@ -1,8 +0,0 @@ -(ns compojure.api.coercion.register-spec - (:require [compojure.api.coercion.core :as cc])) - -(defmethod cc/named-coercion :spec [_] - (deref - (or (resolve 'compojure.api.coercion.spec/default-coercion) - (do (require 'compojure.api.coercion.spec) - (resolve 'compojure.api.coercion.spec/default-coercion))))) diff --git a/src/compojure/api/coercion/schema.clj b/src/compojure/api/coercion/schema.clj index 9a7e01b0..b308d0c2 100644 --- a/src/compojure/api/coercion/schema.clj +++ b/src/compojure/api/coercion/schema.clj @@ -5,9 +5,7 @@ [compojure.api.coercion.core :as cc] [clojure.walk :as walk] [schema.core :as s] - [compojure.api.common :as common] - ;; side effects - compojure.api.coercion.register-schema) + [compojure.api.common :as common]) (:import (java.io File) (schema.core OptionalKey RequiredKey) (schema.utils ValidationError NamedError))) @@ -86,3 +84,5 @@ (->SchemaCoercion :schema options)) (def default-coercion (create-coercion default-options)) + +(defmethod cc/named-coercion :schema [_] default-coercion) diff --git a/src/compojure/api/coercion/spec.clj b/src/compojure/api/coercion/spec.clj index b5d6ad31..9b20481a 100644 --- a/src/compojure/api/coercion/spec.clj +++ b/src/compojure/api/coercion/spec.clj @@ -6,9 +6,7 @@ [clojure.walk :as walk] [compojure.api.coercion.core :as cc] [spec-tools.swagger.core :as swagger] - [compojure.api.common :as common] - ;; side effects - compojure.api.coercion.register-spec) + [compojure.api.common :as common]) (:import (clojure.lang IPersistentMap) (schema.core RequiredKey OptionalKey) (spec_tools.core Spec) @@ -151,3 +149,5 @@ (->SpecCoercion :spec options)) (def default-coercion (create-coercion default-options)) + +(defmethod cc/named-coercion :spec [_] default-coercion)