packages feed

rest-types 1.10.0.3 → 1.10.1

raw patch · 4 files changed

+24/−17 lines, 4 filesdep −bytestringdep −containersdep −unordered-containersdep ~aesondep ~json-schema

Dependencies removed: bytestring, containers, unordered-containers, utf8-string

Dependency ranges changed: aeson, json-schema

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog +### 1.10.1++* Added `ShowUrl` instance for strict and lazy `Text`.+ #### 1.10.0.3  * Use `JSONSchema` `Any` type instead of `Choice []`
rest-types.cabal view
@@ -1,5 +1,5 @@ name:                rest-types-version:             1.10.0.3+version:             1.10.1 description:         Silk Rest Framework Types synopsis:            Silk Rest Framework Types maintainer:          code@silk.co@@ -28,16 +28,12 @@   build-depends:       base == 4.*     , aeson >= 0.7 && < 0.8-    , bytestring >= 0.9 && < 0.11-    , containers >= 0.4 && < 0.6     , generic-aeson == 0.1.*     , hxt >= 9.2 && < 9.4-    , json-schema == 0.5.*+    , json-schema == 0.6.*     , mtl >= 2.0 && < 2.3     , regular == 0.3.*     , regular-xmlpickler == 0.2.*     , rest-stringmap == 0.2.*     , text >= 0.11 && < 1.2-    , unordered-containers == 0.2.*-    , utf8-string == 0.3.*     , uuid >= 1.2 && < 1.4
src/Rest/Types/Container/Resource.hs view
@@ -2,6 +2,8 @@     DeriveDataTypeable   , DeriveGeneric   , EmptyDataDecls+  , GeneralizedNewtypeDeriving+  , StandaloneDeriving   , TemplateHaskell   , TypeFamilies   #-}@@ -22,20 +24,20 @@ import Generics.Regular.XmlPickler (gxpickle) import Rest.StringMap.HashMap.Strict (StringHashMap) import Text.XML.HXT.Arrow.Pickle-import qualified Data.JSON.Schema as Json+import qualified Data.JSON.Schema.Combinators as Json  type KeyValues = StringHashMap String Value -newtype Value = Value { unValue :: String } deriving (Show, Typeable)+newtype Value = Value { unValue :: String }+  deriving (Show, Typeable) +deriving instance ToJSON Value+deriving instance FromJSON Value+instance JSONSchema Value where+  schema _ = Json.value+ instance XmlPickler Value where   xpickle = xpElem "value" $ xpWrap (Value, unValue) xpText0--instance ToJSON   Value where toJSON    = toJSON . unValue-instance FromJSON Value where parseJSON = fmap Value . parseJSON--instance JSONSchema Value where-  schema _ = Json.Value 0 (-1)  data Resource = Resource   { uri        :: String
src/Rest/Types/ShowUrl.hs view
@@ -1,9 +1,12 @@-{-# LANGUAGE TypeSynonymInstances-           , FlexibleInstances-           #-}+{-# LANGUAGE+    FlexibleInstances+  , TypeSynonymInstances+  #-} module Rest.Types.ShowUrl (ShowUrl(..)) where  import Data.UUID+import qualified Data.Text      as ST+import qualified Data.Text.Lazy as LT  class ShowUrl a where   showUrl :: a -> String@@ -12,3 +15,5 @@ instance ShowUrl Int     where showUrl = show instance ShowUrl Integer where showUrl = show instance ShowUrl UUID    where showUrl = show+instance ShowUrl ST.Text where showUrl = ST.unpack+instance ShowUrl LT.Text where showUrl = LT.unpack