Skip to content

Commit

Permalink
Merge pull request #85 from phadej/prepare-for-2.1.3
Browse files Browse the repository at this point in the history
Update CHANGELOG for 2.1.3
  • Loading branch information
phadej authored Oct 2, 2016
2 parents b2ff991 + 814a86e commit 267dfb4
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 27 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
2.1.3
-----

* Add UUID instances (see [#81](https://github.com/GetShopTV/swagger2/pull/81)).
* Add [`UUID`](http://hackage.haskell.org/package/uuid-types/docs/Data-UUID-Types.html#t:UUID) instances (see [#81](https://github.com/GetShopTV/swagger2/pull/81)).
* Add [`TypeError`](https://hackage.haskell.org/package/base-4.9.0.0/docs/GHC-TypeLits.html#g:4) `ToSchema` and `ToParamSchema ByteString` instances (see [#78](https://github.com/GetShopTV/swagger2/pull/78))
* Improve documentation for generic sum type instance derivation (see [#75](https://github.com/GetShopTV/swagger2/pull/75))
* Compile warning free (see [#82](https://github.com/GetShopTV/swagger2/pull/82))

2.1.2.1
-------
Expand Down
8 changes: 5 additions & 3 deletions src/Data/Swagger/Internal/ParamSchema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#if __GLASGOW_HASKELL__ >= 800
-- Generic a is redundant in ToParamSchema a default imple
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
-- For TypeErrors
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
#endif
#include "overlapping-compat.h"
module Data.Swagger.Internal.ParamSchema where
Expand Down Expand Up @@ -207,9 +209,9 @@ instance ToParamSchema TL.Text where
#else
type family ToParamSchemaByteStringError bs where
ToParamSchemaByteStringError bs = TypeError
( Text "Impossible to have an instance " :<>: ShowType (ToParamSchema bs) :<>: Text "."
:$$: Text "Please, use a newtype wrapper around " :<>: ShowType bs :<>: Text " instead."
:$$: Text "Consider using byteParamSchema or binaryParamSchema templates." )
( 'Text "Impossible to have an instance " :<>: ShowType (ToParamSchema bs) :<>: Text "."
:$$: 'Text "Please, use a newtype wrapper around " :<>: ShowType bs :<>: Text " instead."
:$$: 'Text "Consider using byteParamSchema or binaryParamSchema templates." )

instance ToParamSchemaByteStringError BS.ByteString => ToParamSchema BS.ByteString where toParamSchema = error "impossible"
instance ToParamSchemaByteStringError BSL.ByteString => ToParamSchema BSL.ByteString where toParamSchema = error "impossible"
Expand Down
2 changes: 2 additions & 0 deletions src/Data/Swagger/Internal/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#if __GLASGOW_HASKELL__ >= 800
-- Few generics related redundant constraints
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
-- For TypeErrors
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
#endif
#include "overlapping-compat.h"
module Data.Swagger.Internal.Schema where
Expand Down
5 changes: 5 additions & 0 deletions stack-lts-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ extra-deps:
- generics-sop-0.2.1.0
- insert-ordered-containers-0.1.0.1
- primitive-0.6.1.0
- QuickCheck-2.8.2
- tagged-0.8.4
- unordered-containers-0.2.7.0
resolver: lts-2.22
flags:
aeson:
old-locale: true
QuickCheck:
base3: false
base4: true
base4point8: false
2 changes: 1 addition & 1 deletion swagger2.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test-suite spec
, insert-ordered-containers
, HUnit
, mtl
, QuickCheck
, QuickCheck >=2.8.2
, swagger2
, text
, time
Expand Down
2 changes: 1 addition & 1 deletion test/Data/Swagger/ParamSchemaSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import SpecCommon
import Test.Hspec

checkToParamSchema :: ToParamSchema a => Proxy a -> Value -> Spec
checkToParamSchema proxy js = (toParamSchema proxy :: ParamSchema (SwaggerKindNormal Param)) <=> js
checkToParamSchema proxy js = (toParamSchema proxy :: ParamSchema ('SwaggerKindNormal Param)) <=> js

spec :: Spec
spec = do
Expand Down
20 changes: 1 addition & 19 deletions test/Data/Swagger/Schema/ValidationSpec.hs
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.Swagger.Schema.ValidationSpec where

import Control.Applicative
import Data.Aeson
import Data.Aeson.Types
import Data.Int
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import Data.IntSet (IntSet)
import Data.Hashable (Hashable)
import "unordered-containers" Data.HashSet (HashSet)
import qualified "unordered-containers" Data.HashSet as HashSet
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HashMap
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Proxy
import Data.Time
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Word
import GHC.Generics

import Data.Swagger
import Data.Swagger.Declare
import Data.Swagger.Schema.Validation

import SpecCommon
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck
Expand Down Expand Up @@ -168,18 +162,6 @@ instance Arbitrary Light where

-- Arbitrary instances for common types

#if MIN_VERSION_QuickCheck(2,8,2)
#else
instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map k v) where
arbitrary = Map.fromList <$> arbitrary

instance Arbitrary a => Arbitrary (IntMap a) where
arbitrary = IntMap.fromList <$> arbitrary

instance (Ord a, Arbitrary a) => Arbitrary (Set a) where
arbitrary = Set.fromList <$> arbitrary
#endif

instance (Eq k, Hashable k, Arbitrary k, Arbitrary v) => Arbitrary (HashMap k v) where
arbitrary = HashMap.fromList <$> arbitrary

Expand Down
2 changes: 0 additions & 2 deletions test/Data/Swagger/SchemaSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import Control.Lens ((^.))
import Data.Aeson
import Data.Aeson.QQ
import Data.Char
import qualified Data.HashMap.Strict as HashMap
import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import Data.Proxy
import Data.Set (Set)
import qualified Data.Set as Set
import qualified Data.Text as Text
import GHC.Generics

Expand Down

0 comments on commit 267dfb4

Please sign in to comment.