servant-quickcheck-0.0.7.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.

Minimal complete definition

genRequest

Methods

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

Instances

HasGenRequest * EmptyAPI Source # 
(HasGenRequest * a, HasGenRequest * b) => HasGenRequest * ((:<|>) a b) Source # 

Methods

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

HasGenRequest * a => HasGenRequest * (WithNamedContext x y a) Source # 

Methods

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

HasGenRequest * a => HasGenRequest * ((:>) * HttpVersion a) Source # 

Methods

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

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

Methods

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

HasGenRequest * a => HasGenRequest * ((:>) * RemoteHost a) Source # 

Methods

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

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

Methods

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

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

Methods

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

(KnownSymbol x, HasGenRequest * b) => HasGenRequest * ((:>) * (QueryFlag x) b) Source # 

Methods

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

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

Methods

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

HasGenRequest * a => HasGenRequest * ((:>) * IsSecure a) Source # 

Methods

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

HasGenRequest * api => HasGenRequest * ((:>) * (Summary d) api) Source # 

Methods

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

HasGenRequest * api => HasGenRequest * ((:>) * (Description d) api) Source # 

Methods

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

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

Methods

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

(Arbitrary c, HasGenRequest * b, ToHttpApiData c) => HasGenRequest * ((:>) * (CaptureAll x c) b) Source # 

Methods

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

HasGenRequest * a => HasGenRequest * ((:>) * (BasicAuth x y) a) Source # 

Methods

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

HasGenRequest * a => HasGenRequest * ((:>) * Vault a) Source # 

Methods

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

(KnownSymbol path, HasGenRequest * b) => HasGenRequest * ((:>) Symbol path b) Source # 

Methods

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

ReflectMethod k method => HasGenRequest * (Verb k method status cts a) Source # 

Methods

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