git.iko.soy/deriving-openapi3
on master help sign in
Added typeable superclass
c0c7c3diko
src/Deriving/OpenApi.hs+3−2
@@ -17,6 +17,7 @@ import Data.OpenApi.Internal.Schema
17import Data.Proxy
17import Data.Proxy
18import Data.Text (Text)
18import Data.Text (Text)
19import qualified Data.Text as T
19import qualified Data.Text as T
20+import Data.Typeable
20import Deriving.Aeson
21import Deriving.Aeson
21import GHC.Generics
22import GHC.Generics
22import GHC.TypeLits
23import GHC.TypeLits
@@ -24,7 +25,7 @@ import Servant.API
24
25
25type CustomOpenApi = CustomJSON
26type CustomOpenApi = CustomJSON
26
27
27−instance (OpenApiOptions xs, GToSchema (Rep x), Generic x) => ToSchema (CustomJSON xs x) where
28+instance (OpenApiOptions xs, GToSchema (Rep x), Generic x, Typeable x, Typeable xs) => ToSchema (CustomJSON xs x) where
28 declareNamedSchema Proxy =
29 declareNamedSchema Proxy =
29 openApiSchemaModifier @xs <$> genericDeclareNamedSchema (openApiOptions @xs) (Proxy @x)
30 openApiSchemaModifier @xs <$> genericDeclareNamedSchema (openApiOptions @xs) (Proxy @x)
30
31
@@ -79,7 +80,7 @@ instance (StringModifier f, OpenApiOptions xs) => OpenApiOptions (ConstructorTag
79 openApiOptions = (openApiOptions @xs) {constructorTagModifier = getStringModifier @f}
80 openApiOptions = (openApiOptions @xs) {constructorTagModifier = getStringModifier @f}
80
81
81instance
82instance
82− (OpenApiOptions xs, TypeError ( 'Text "openapi3-deriving does not currently the `TagSingleConstructors` modifier.")) =>
83+ (OpenApiOptions xs, TypeError ('Text "openapi3-deriving does not currently the `TagSingleConstructors` modifier.")) =>
83 OpenApiOptions (TagSingleConstructors ': xs)
84 OpenApiOptions (TagSingleConstructors ': xs)
84 where
85 where
85 openApiOptions = undefined
86 openApiOptions = undefined
stack.yaml+1−1
@@ -4,4 +4,4 @@ packages:
4 - .
4 - .
5
5
6extra-deps:
6extra-deps:
7− - openapi3-3.0.0.1@sha256:205669d14c5b48d2275e0bac41d78c9bfdb925ef9a8e3265662ce51a9e6d8139,4641
7+ - openapi3-3.1.0