diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Changelog
 
+## [0.0.1.4] - 2024-07-29
+
+* Non-orphan version of the `ToSchema` deriving.
+
 ## [0.0.1.3] - 2024-07-26
 
 * Support for `autodocodec >=0.4`.
diff --git a/autodocodec-swagger2.cabal b/autodocodec-swagger2.cabal
--- a/autodocodec-swagger2.cabal
+++ b/autodocodec-swagger2.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           autodocodec-swagger2
-version:        0.0.1.3
+version:        0.0.1.4
 synopsis:       Autodocodec interpreters for swagger2
 homepage:       https://github.com/NorfairKing/autodocodec#readme
 bug-reports:    https://github.com/NorfairKing/autodocodec/issues
@@ -27,6 +27,7 @@
   exposed-modules:
       Autodocodec.Swagger
       Autodocodec.Swagger.DerivingVia
+      Autodocodec.Swagger.DerivingVia.NonOrphan
       Autodocodec.Swagger.Schema
   other-modules:
       Paths_autodocodec_swagger2
diff --git a/src/Autodocodec/Swagger/DerivingVia.hs b/src/Autodocodec/Swagger/DerivingVia.hs
--- a/src/Autodocodec/Swagger/DerivingVia.hs
+++ b/src/Autodocodec/Swagger/DerivingVia.hs
@@ -3,13 +3,14 @@
 
 module Autodocodec.Swagger.DerivingVia where
 
-import Autodocodec
-import Autodocodec.Swagger.Schema
-import Data.Proxy
-import Data.Swagger as Swagger
+import Autodocodec (Autodocodec, HasCodec)
+import Autodocodec.Swagger.Schema (declareNamedSchemaViaCodec)
+import Data.Proxy (Proxy (..))
+import qualified Data.Swagger as Swagger
 
 -- | An instance for 'Autodocodec' that lets you use 'DerivingVia' to derive 'Swagger.ToSchema' if your type has a 'HasCodec' instance.
 --
 -- > deriving (Swagger.ToSchema) via (Autodocodec FooBar)
 instance (HasCodec a) => Swagger.ToSchema (Autodocodec a) where
-  declareNamedSchema (Proxy :: Proxy (Autodocodec a)) = declareNamedSchemaViaCodec (Proxy :: Proxy a)
+  -- See comments in 'Autodocodec.OpenAPI.DerivingVia' for the reason why this is defined like this.
+  declareNamedSchema = let schema = declareNamedSchemaViaCodec (Proxy :: Proxy a) in const schema
diff --git a/src/Autodocodec/Swagger/DerivingVia/NonOrphan.hs b/src/Autodocodec/Swagger/DerivingVia/NonOrphan.hs
new file mode 100644
--- /dev/null
+++ b/src/Autodocodec/Swagger/DerivingVia/NonOrphan.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module Autodocodec.Swagger.DerivingVia.NonOrphan (AutodocodecSwagger (..)) where
+
+import Autodocodec (HasCodec)
+import Autodocodec.Swagger.Schema (declareNamedSchemaViaCodec)
+import Data.Proxy (Proxy (..))
+import qualified Data.Swagger as Swagger
+
+newtype AutodocodecSwagger a = AutodocodecSwagger {unAutodocodecSwagger :: a}
+
+-- | An non-orphan instance for 'AutodocodecSwagger' that lets you use 'DerivingVia' to derive 'Swagger.ToSchema' if your type has a 'HasCodec' instance.
+--
+-- > deriving (Swagger.ToSchema) via (AutodocodecSwagger FooBar)
+instance (HasCodec a) => Swagger.ToSchema (AutodocodecSwagger a) where
+  -- See comments in 'Autodocodec.OpenAPI.DerivingVia' for the reason why this is defined like this.
+  declareNamedSchema = let schema = declareNamedSchemaViaCodec (Proxy :: Proxy a) in const schema
