@@ -1,3 +1,4 @@
2-- Module: Data.Swagger
3-- Module: Data.Swagger
3-- Maintainer: Nickolay Kudasov <nickolay@getshoptv.com>
4-- Maintainer: Nickolay Kudasov <nickolay@getshoptv.com>
@@ -288,6 +289,21 @@ import Data.Swagger.Internal
289-- we can not derive a valid schema for a mix of the above. The following will result in a type error
290-- we can not derive a valid schema for a mix of the above. The following will result in a type error
292+#if __GLASGOW_HASKELL__ < 800
293+-- >>> data BadMixedType = ChoiceBool Bool | JustTag deriving Generic
294+-- >>> instance ToSchema BadMixedType
297+-- ... • No instance for (Data.Swagger.Internal.TypeShape.CannotDeriveSchemaForMixedSumType
299+-- ... arising from a use of ‘Data.Swagger.Internal.Schema.$dmdeclareNamedSchema’
300+-- ... • In the expression:
301+-- ... Data.Swagger.Internal.Schema.$dmdeclareNamedSchema @BadMixedType
302+-- ... In an equation for ‘declareNamedSchema’:
303+-- ... declareNamedSchema
304+-- ... = Data.Swagger.Internal.Schema.$dmdeclareNamedSchema @BadMixedType
305+-- ... In the instance declaration for ‘ToSchema BadMixedType’
291-- >>> data BadMixedType = ChoiceBool Bool | JustTag deriving Generic
307-- >>> data BadMixedType = ChoiceBool Bool | JustTag deriving Generic
292-- >>> instance ToSchema BadMixedType
308-- >>> instance ToSchema BadMixedType
@@ -304,6 +320,7 @@ import Data.Swagger.Internal
304-- ... declareNamedSchema
320-- ... declareNamedSchema
305-- ... = Data.Swagger.Internal.Schema.$dmdeclareNamedSchema @BadMixedType
321-- ... = Data.Swagger.Internal.Schema.$dmdeclareNamedSchema @BadMixedType
306-- ... In the instance declaration for ‘ToSchema BadMixedType’
322-- ... In the instance declaration for ‘ToSchema BadMixedType’
308-- We can use 'genericDeclareNamedSchemaUnrestricted' to try our best to represent this type as a Swagger Schema and match 'ToJSON':
325-- We can use 'genericDeclareNamedSchemaUnrestricted' to try our best to represent this type as a Swagger Schema and match 'ToJSON':