mirror of
https://github.com/ilyakooo0/deriving-openapi3.git
synced 2024-09-11 10:25:55 +03:00
Added typeable superclass
This commit is contained in:
parent
29e7d7ec58
commit
c0c7c3d300
@ -17,6 +17,7 @@ import Data.OpenApi.Internal.Schema
|
||||
import Data.Proxy
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import Data.Typeable
|
||||
import Deriving.Aeson
|
||||
import GHC.Generics
|
||||
import GHC.TypeLits
|
||||
@ -24,7 +25,7 @@ import Servant.API
|
||||
|
||||
type CustomOpenApi = CustomJSON
|
||||
|
||||
instance (OpenApiOptions xs, GToSchema (Rep x), Generic x) => ToSchema (CustomJSON xs x) where
|
||||
instance (OpenApiOptions xs, GToSchema (Rep x), Generic x, Typeable x, Typeable xs) => ToSchema (CustomJSON xs x) where
|
||||
declareNamedSchema Proxy =
|
||||
openApiSchemaModifier @xs <$> genericDeclareNamedSchema (openApiOptions @xs) (Proxy @x)
|
||||
|
||||
@ -79,7 +80,7 @@ instance (StringModifier f, OpenApiOptions xs) => OpenApiOptions (ConstructorTag
|
||||
openApiOptions = (openApiOptions @xs) {constructorTagModifier = getStringModifier @f}
|
||||
|
||||
instance
|
||||
(OpenApiOptions xs, TypeError ( 'Text "openapi3-deriving does not currently the `TagSingleConstructors` modifier.")) =>
|
||||
(OpenApiOptions xs, TypeError ('Text "openapi3-deriving does not currently the `TagSingleConstructors` modifier.")) =>
|
||||
OpenApiOptions (TagSingleConstructors ': xs)
|
||||
where
|
||||
openApiOptions = undefined
|
||||
|
@ -4,4 +4,4 @@ packages:
|
||||
- .
|
||||
|
||||
extra-deps:
|
||||
- openapi3-3.0.0.1@sha256:205669d14c5b48d2275e0bac41d78c9bfdb925ef9a8e3265662ce51a9e6d8139,4641
|
||||
- openapi3-3.1.0
|
||||
|
Loading…
Reference in New Issue
Block a user