@@ -344,8 +344,8 @@ deriving instance Typeable (SwaggerType t)
344344swaggerTypeConstr :: Data (SwaggerType t) => SwaggerType t -> Constr
345345swaggerTypeConstr t = mkConstr (dataTypeOf t) (show t) [] Prefix
346346
347−swaggerTypeDataType :: Data (SwaggerType t) => [SwaggerType t] -> SwaggerType t -> DataType
348−swaggerTypeDataType cons _ = mkDataType "Data.Swagger.SwaggerType" $ map swaggerTypeConstr cons
347+swaggerTypeDataType :: Data (SwaggerType t) => SwaggerType t -> DataType
348+swaggerTypeDataType _ = mkDataType "Data.Swagger.SwaggerType" swaggerTypeConstrs
349349
350350swaggerCommonTypes :: [SwaggerType t]
351351swaggerCommonTypes = [SwaggerString, SwaggerNumber, SwaggerInteger, SwaggerBoolean, SwaggerArray]
@@ -354,23 +354,26 @@ swaggerParamTypes :: [SwaggerType ParamOtherSchema]
354354swaggerParamTypes = swaggerCommonTypes ++ [SwaggerFile]
355355
356356swaggerSchemaTypes :: [SwaggerType Schema]
357−swaggerSchemaTypes = swaggerCommonTypes ++ [SwaggerNull, SwaggerObject]
357+swaggerSchemaTypes = swaggerCommonTypes ++ [error "SwaggerFile is invalid SwaggerType Schema", SwaggerNull, SwaggerObject]
358+
359+swaggerTypeConstrs :: [Constr]
360+swaggerTypeConstrs = map swaggerTypeConstr (swaggerCommonTypes :: [SwaggerType Schema])
361+ ++ [swaggerTypeConstr SwaggerFile, swaggerTypeConstr SwaggerNull, swaggerTypeConstr SwaggerObject]
358362
359363instance {-# OVERLAPPABLE #-} Typeable t => Data (SwaggerType t) where
360− gunfold = gunfoldEnum "SwaggerType" $ zip [1..] swaggerCommonTypes
364+ gunfold = gunfoldEnum "SwaggerType" swaggerCommonTypes
361365 toConstr = swaggerTypeConstr
362− dataTypeOf = swaggerTypeDataType swaggerCommonTypes
366+ dataTypeOf = swaggerTypeDataType
363367
364368instance {-# OVERLAPPING #-} Data (SwaggerType ParamOtherSchema) where
365− gunfold = gunfoldEnum "SwaggerType ParamOtherSchema" $ zip [1..] swaggerParamTypes
369+ gunfold = gunfoldEnum "SwaggerType ParamOtherSchema" swaggerParamTypes
366370 toConstr = swaggerTypeConstr
367− dataTypeOf = swaggerTypeDataType swaggerParamTypes
371+ dataTypeOf = swaggerTypeDataType
368372
369373instance {-# OVERLAPPING #-} Data (SwaggerType Schema) where
370− gunfold = gunfoldEnum "SwaggerType Schema" $ zip ns swaggerSchemaTypes
371− where ns = [1, 2, 3, 4, 5, 7, 8] -- skipping constructor #6 here
374+ gunfold = gunfoldEnum "SwaggerType Schema" swaggerSchemaTypes
372375 toConstr = swaggerTypeConstr
373− dataTypeOf = swaggerTypeDataType swaggerSchemaTypes
376+ dataTypeOf = swaggerTypeDataType
374377
375378data ParamLocation
376379 = -- | Parameters that are appended to the URL.
@@ -424,7 +427,7 @@ collectionCommonFormats :: [CollectionFormat t]
424427collectionCommonFormats = [ CollectionCSV, CollectionSSV, CollectionTSV, CollectionPipes ]
425428
426429instance {-# OVERLAPPABLE #-} Data t => Data (CollectionFormat t) where
427− gunfold = gunfoldEnum "CollectionFormat" $ zip [1..] collectionCommonFormats
430+ gunfold = gunfoldEnum "CollectionFormat" collectionCommonFormats
428431 toConstr = collectionFormatConstr
429432 dataTypeOf _ = collectionFormatDataType
430433