servant-quickcheck-0.0.10.0: QuickCheck entire APIs

Safe HaskellNone
LanguageHaskell2010

Servant.QuickCheck.Internal.HasGenRequest

Synopsis

Documentation

runGenRequest :: HasGenRequest a => Proxy a -> Gen (BaseUrl -> Request) Source #

This function returns a QuickCheck `Gen a` when passed a servant API value, typically a `Proxy API`. The generator returned is a function that accepts a BaseUrl and returns a Request, which can then be used to issue network requests. This Gen type makes it easier to compare distinct APIs across different BaseUrls.

class HasGenRequest a where Source #

This is the core Servant-Quickcheck generator, which, when given a `Proxy API` will return a pair of Int and `Gen a`, where a is a function from BaseUrl to a Request. The Int is a weight for the QuickCheck frequency function which ensures a random distribution across all endpoints in an API.

Methods

genRequest :: Proxy a -> (Int, Gen (BaseUrl -> Request)) Source #

Instances
HasGenRequest EmptyAPI Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

ReflectMethod method => HasGenRequest (NoContentVerb method :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (NoContentVerb method) -> (Int, Gen (BaseUrl -> Request)) Source #

(HasGenRequest a, HasGenRequest b) => HasGenRequest (a :<|> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (a :<|> b) -> (Int, Gen (BaseUrl -> Request)) Source #

HasGenRequest a => HasGenRequest (WithNamedContext x y a :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

HasGenRequest a => HasGenRequest (HttpVersion :> a :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

(AllMimeRender x c, Arbitrary c, HasGenRequest b) => HasGenRequest (ReqBody' mods x c :> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (ReqBody' mods x c :> b) -> (Int, Gen (BaseUrl -> Request)) Source #

HasGenRequest a => HasGenRequest (RemoteHost :> a :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

(KnownSymbol x, Arbitrary c, ToHttpApiData c, HasGenRequest b) => HasGenRequest (QueryParam' mods x c :> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (QueryParam' mods x c :> b) -> (Int, Gen (BaseUrl -> Request)) Source #

(KnownSymbol x, Arbitrary c, ToHttpApiData c, HasGenRequest b) => HasGenRequest (QueryParams x c :> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (QueryParams x c :> b) -> (Int, Gen (BaseUrl -> Request)) Source #

(KnownSymbol x, HasGenRequest b) => HasGenRequest (QueryFlag x :> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (QueryFlag x :> b) -> (Int, Gen (BaseUrl -> Request)) Source #

(Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c) => HasGenRequest (Header' mods h c :> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (Header' mods h c :> b) -> (Int, Gen (BaseUrl -> Request)) Source #

HasGenRequest a => HasGenRequest (IsSecure :> a :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

HasGenRequest api => HasGenRequest (Summary d :> api :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (Summary d :> api) -> (Int, Gen (BaseUrl -> Request)) Source #

HasGenRequest api => HasGenRequest (Description d :> api :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (Description d :> api) -> (Int, Gen (BaseUrl -> Request)) Source #

(Arbitrary c, HasGenRequest b, ToHttpApiData c) => HasGenRequest (Capture' mods x c :> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (Capture' mods x c :> b) -> (Int, Gen (BaseUrl -> Request)) Source #

(Arbitrary c, HasGenRequest b, ToHttpApiData c) => HasGenRequest (CaptureAll x c :> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (CaptureAll x c :> b) -> (Int, Gen (BaseUrl -> Request)) Source #

HasGenRequest a => HasGenRequest (BasicAuth x y :> a :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (BasicAuth x y :> a) -> (Int, Gen (BaseUrl -> Request)) Source #

HasGenRequest a => HasGenRequest (Vault :> a :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (Vault :> a) -> (Int, Gen (BaseUrl -> Request)) Source #

(KnownSymbol path, HasGenRequest b) => HasGenRequest (path :> b :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (path :> b) -> (Int, Gen (BaseUrl -> Request)) Source #

ReflectMethod method => HasGenRequest (Verb method status cts a :: Type) Source # 
Instance details

Defined in Servant.QuickCheck.Internal.HasGenRequest

Methods

genRequest :: Proxy (Verb method status cts a) -> (Int, Gen (BaseUrl -> Request)) Source #