hscim-0.4.0.2: hscim json schema and server implementation
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Scim.Schema.Common

Synopsis

Documentation

data WithId id a Source #

Constructors

WithId 

Fields

Instances

Instances details
(FromJSON id, FromJSON a) => FromJSON (WithId id a) Source # 
Instance details

Defined in Web.Scim.Schema.Common

(ToJSON id, ToJSON a) => ToJSON (WithId id a) Source # 
Instance details

Defined in Web.Scim.Schema.Common

(Show id, Show a) => Show (WithId id a) Source # 
Instance details

Defined in Web.Scim.Schema.Common

Methods

showsPrec :: Int -> WithId id a -> ShowS #

show :: WithId id a -> String #

showList :: [WithId id a] -> ShowS #

(Eq id, Eq a) => Eq (WithId id a) Source # 
Instance details

Defined in Web.Scim.Schema.Common

Methods

(==) :: WithId id a -> WithId id a -> Bool #

(/=) :: WithId id a -> WithId id a -> Bool #

newtype URI Source #

Constructors

URI 

Fields

Instances

Instances details
FromJSON URI Source # 
Instance details

Defined in Web.Scim.Schema.Common

ToJSON URI Source # 
Instance details

Defined in Web.Scim.Schema.Common

Show URI Source # 
Instance details

Defined in Web.Scim.Schema.Common

Methods

showsPrec :: Int -> URI -> ShowS #

show :: URI -> String #

showList :: [URI] -> ShowS #

Eq URI Source # 
Instance details

Defined in Web.Scim.Schema.Common

Methods

(==) :: URI -> URI -> Bool #

(/=) :: URI -> URI -> Bool #

jsonLower :: forall m. m ~ Either [Text] => Value -> m Value Source #

Turn all keys in a JSON object to lowercase recursively. This is applied to the aeson Value to be parsed; parseOptions is applied to the keys passed to (.:) etc. If an object contains two fields that only differ in casing, Left is returned with a list of the offending fields.

NB: be careful to not mix 'Data.Text.{toLower,toCaseFold}', toLower, and foldCase. They're not all the same thing! https://github.com/basvandijk/case-insensitive/issues/31

(FUTUREWORK: The "recursively" part is a bit of a waste and could be dropped, but we would have to spend more effort in making sure it is always called manually in nested parsers.)