autodocodec-swagger2 0.0.1.4 → 0.1.0.0
raw patch · 4 files changed
+12/−25 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Autodocodec.Swagger.DerivingVia: instance Autodocodec.Class.HasCodec a => Data.Swagger.Internal.Schema.ToSchema (Autodocodec.DerivingVia.Autodocodec a)
- Autodocodec.Swagger.DerivingVia.NonOrphan: AutodocodecSwagger :: a -> AutodocodecSwagger a
- Autodocodec.Swagger.DerivingVia.NonOrphan: [unAutodocodecSwagger] :: AutodocodecSwagger a -> a
- Autodocodec.Swagger.DerivingVia.NonOrphan: instance Autodocodec.Class.HasCodec a => Data.Swagger.Internal.Schema.ToSchema (Autodocodec.Swagger.DerivingVia.NonOrphan.AutodocodecSwagger a)
- Autodocodec.Swagger.DerivingVia.NonOrphan: newtype AutodocodecSwagger a
+ Autodocodec.Swagger.DerivingVia: AutodocodecSwagger :: a -> AutodocodecSwagger a
+ Autodocodec.Swagger.DerivingVia: [unAutodocodecSwagger] :: AutodocodecSwagger a -> a
+ Autodocodec.Swagger.DerivingVia: instance Autodocodec.Class.HasCodec a => Data.Swagger.Internal.Schema.ToSchema (Autodocodec.Swagger.DerivingVia.AutodocodecSwagger a)
+ Autodocodec.Swagger.DerivingVia: newtype AutodocodecSwagger a
Files
- CHANGELOG.md +4/−0
- autodocodec-swagger2.cabal +1/−2
- src/Autodocodec/Swagger/DerivingVia.hs +7/−6
- src/Autodocodec/Swagger/DerivingVia/NonOrphan.hs +0/−17
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog +## [0.1.0.0] - 2024-07-29++* Dropped support for orphan instances.+ ## [0.0.1.4] - 2024-07-29 * Non-orphan version of the `ToSchema` deriving.
autodocodec-swagger2.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: autodocodec-swagger2-version: 0.0.1.4+version: 0.1.0.0 synopsis: Autodocodec interpreters for swagger2 homepage: https://github.com/NorfairKing/autodocodec#readme bug-reports: https://github.com/NorfairKing/autodocodec/issues@@ -27,7 +27,6 @@ exposed-modules: Autodocodec.Swagger Autodocodec.Swagger.DerivingVia- Autodocodec.Swagger.DerivingVia.NonOrphan Autodocodec.Swagger.Schema other-modules: Paths_autodocodec_swagger2
src/Autodocodec/Swagger/DerivingVia.hs view
@@ -1,16 +1,17 @@ {-# LANGUAGE ScopedTypeVariables #-}-{-# OPTIONS_GHC -fno-warn-orphans #-} -module Autodocodec.Swagger.DerivingVia where+module Autodocodec.Swagger.DerivingVia (AutodocodecSwagger (..)) where -import Autodocodec (Autodocodec, HasCodec)+import 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.+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 (Autodocodec FooBar)-instance (HasCodec a) => Swagger.ToSchema (Autodocodec a) where+-- > 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
− src/Autodocodec/Swagger/DerivingVia/NonOrphan.hs
@@ -1,17 +0,0 @@-{-# 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