openapi3-3.0.2.0: OpenAPI 3.0 data model
Safe HaskellNone
LanguageHaskell2010

Data.OpenApi.Internal.TypeShape

Synopsis

Documentation

data TypeShape Source #

Shape of a datatype.

Constructors

Enumeration

A simple enumeration.

SumOfProducts

A product or a sum of non-unit products.

Mixed

Mixed sum type with both unit and non-unit constructors.

type family ProdCombine (a :: TypeShape) (b :: TypeShape) :: TypeShape where ... Source #

A combined shape for a product type.

type family SumCombine (a :: TypeShape) (b :: TypeShape) :: TypeShape where ... Source #

A combined shape for a sum type.

type family TypeHasSimpleShape t (f :: Symbol) :: Constraint where ... Source #

type family GenericHasSimpleShape t (f :: Symbol) (s :: TypeShape) :: Constraint where ... Source #

Equations

GenericHasSimpleShape t f Enumeration = () 
GenericHasSimpleShape t f SumOfProducts = () 
GenericHasSimpleShape t f Mixed = TypeError ((((((Text "Cannot derive Generic-based Swagger Schema for " :<>: ShowType t) :$$: (ShowType t :<>: Text " is a mixed sum type (has both unit and non-unit constructors).")) :$$: Text "Swagger does not have a good representation for these types.") :$$: ((Text "Use " :<>: Text f) :<>: Text " if you want to derive schema")) :$$: Text "that matches aeson's Generic-based toJSON,") :$$: Text "but that's not supported by some Swagger tools.") 

type family GenericShape (g :: * -> *) :: TypeShape Source #

Infer a TypeShape for a generic representation of a type.

Instances

Instances details
type GenericShape (f :+: g) Source # 
Instance details

Defined in Data.OpenApi.Internal.TypeShape

type GenericShape (f :*: g) Source # 
Instance details

Defined in Data.OpenApi.Internal.TypeShape

type GenericShape (D1 d f) Source # 
Instance details

Defined in Data.OpenApi.Internal.TypeShape

type GenericShape (C1 c (f :*: g)) Source # 
Instance details

Defined in Data.OpenApi.Internal.TypeShape

type GenericShape (C1 c (f :*: g)) = 'SumOfProducts
type GenericShape (C1 c (S1 s f)) Source # 
Instance details

Defined in Data.OpenApi.Internal.TypeShape

type GenericShape (C1 c (S1 s f)) = 'SumOfProducts
type GenericShape (C1 c (U1 :: Type -> Type)) Source # 
Instance details

Defined in Data.OpenApi.Internal.TypeShape

type GenericShape (C1 c (U1 :: Type -> Type)) = 'Enumeration