@@ -344,8 +344,8 @@ deriving instance Typeable (SwaggerType t)
344swaggerTypeConstr :: Data (SwaggerType t) => SwaggerType t -> Constr
344swaggerTypeConstr :: Data (SwaggerType t) => SwaggerType t -> Constr
345swaggerTypeConstr t = mkConstr (dataTypeOf t) (show t) [] Prefix
345swaggerTypeConstr t = mkConstr (dataTypeOf t) (show t) [] Prefix
347−swaggerTypeDataType :: Data (SwaggerType t) => [SwaggerType t] -> SwaggerType t -> DataType
347+swaggerTypeDataType :: Data (SwaggerType t) => SwaggerType t -> DataType
348−swaggerTypeDataType cons _ = mkDataType "Data.Swagger.SwaggerType" $ map swaggerTypeConstr cons
348+swaggerTypeDataType _ = mkDataType "Data.Swagger.SwaggerType" swaggerTypeConstrs
350swaggerCommonTypes :: [SwaggerType t]
350swaggerCommonTypes :: [SwaggerType t]
351swaggerCommonTypes = [SwaggerString, SwaggerNumber, SwaggerInteger, SwaggerBoolean, SwaggerArray]
351swaggerCommonTypes = [SwaggerString, SwaggerNumber, SwaggerInteger, SwaggerBoolean, SwaggerArray]
@@ -354,23 +354,26 @@ swaggerParamTypes :: [SwaggerType ParamOtherSchema]
354swaggerParamTypes = swaggerCommonTypes ++ [SwaggerFile]
354swaggerParamTypes = swaggerCommonTypes ++ [SwaggerFile]
356swaggerSchemaTypes :: [SwaggerType Schema]
356swaggerSchemaTypes :: [SwaggerType Schema]
357−swaggerSchemaTypes = swaggerCommonTypes ++ [SwaggerNull, SwaggerObject]
357+swaggerSchemaTypes = swaggerCommonTypes ++ [error "SwaggerFile is invalid SwaggerType Schema", SwaggerNull, SwaggerObject]
359+swaggerTypeConstrs :: [Constr]
360+swaggerTypeConstrs = map swaggerTypeConstr (swaggerCommonTypes :: [SwaggerType Schema])
361+ ++ [swaggerTypeConstr SwaggerFile, swaggerTypeConstr SwaggerNull, swaggerTypeConstr SwaggerObject]
359instance {-# OVERLAPPABLE #-} Typeable t => Data (SwaggerType t) where
363instance {-# OVERLAPPABLE #-} Typeable t => Data (SwaggerType t) where
360− gunfold = gunfoldEnum "SwaggerType" $ zip [1..] swaggerCommonTypes
364+ gunfold = gunfoldEnum "SwaggerType" swaggerCommonTypes
361 toConstr = swaggerTypeConstr
365 toConstr = swaggerTypeConstr
362− dataTypeOf = swaggerTypeDataType swaggerCommonTypes
366+ dataTypeOf = swaggerTypeDataType
364instance {-# OVERLAPPING #-} Data (SwaggerType ParamOtherSchema) where
368instance {-# OVERLAPPING #-} Data (SwaggerType ParamOtherSchema) where
365− gunfold = gunfoldEnum "SwaggerType ParamOtherSchema" $ zip [1..] swaggerParamTypes
369+ gunfold = gunfoldEnum "SwaggerType ParamOtherSchema" swaggerParamTypes
366 toConstr = swaggerTypeConstr
370 toConstr = swaggerTypeConstr
367− dataTypeOf = swaggerTypeDataType swaggerParamTypes
371+ dataTypeOf = swaggerTypeDataType
369instance {-# OVERLAPPING #-} Data (SwaggerType Schema) where
373instance {-# OVERLAPPING #-} Data (SwaggerType Schema) where
370− gunfold = gunfoldEnum "SwaggerType Schema" $ zip ns swaggerSchemaTypes
374+ gunfold = gunfoldEnum "SwaggerType Schema" swaggerSchemaTypes
371− where ns = [1, 2, 3, 4, 5, 7, 8] -- skipping constructor #6 here
372 toConstr = swaggerTypeConstr
375 toConstr = swaggerTypeConstr
373− dataTypeOf = swaggerTypeDataType swaggerSchemaTypes
376+ dataTypeOf = swaggerTypeDataType
375data ParamLocation
378data ParamLocation
376 = -- | Parameters that are appended to the URL.
379 = -- | Parameters that are appended to the URL.
@@ -424,7 +427,7 @@ collectionCommonFormats :: [CollectionFormat t]
424collectionCommonFormats = [ CollectionCSV, CollectionSSV, CollectionTSV, CollectionPipes ]
427collectionCommonFormats = [ CollectionCSV, CollectionSSV, CollectionTSV, CollectionPipes ]
426instance {-# OVERLAPPABLE #-} Data t => Data (CollectionFormat t) where
429instance {-# OVERLAPPABLE #-} Data t => Data (CollectionFormat t) where
427− gunfold = gunfoldEnum "CollectionFormat" $ zip [1..] collectionCommonFormats
430+ gunfold = gunfoldEnum "CollectionFormat" collectionCommonFormats
428 toConstr = collectionFormatConstr
431 toConstr = collectionFormatConstr
429 dataTypeOf _ = collectionFormatDataType
432 dataTypeOf _ = collectionFormatDataType