servant-0.13: A family of combinators for defining webservices APIs

Safe HaskellSafe
LanguageHaskell2010

Servant.API.Capture

Synopsis

Documentation

type Capture = Capture' '[] Source #

Capture a value from the request path under a certain type a.

Example:

>>> -- GET /books/:isbn
>>> type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book

data Capture' (mods :: [*]) (sym :: Symbol) (a :: *) Source #

Capture which can be modified. For example with Description.

Instances

(ToHttpApiData v, HasLink * sub) => HasLink * ((:>) * (Capture' mods sym v) sub) Source # 

Associated Types

type MkLink ((* :> Capture' mods sym v) sub) (endpoint :: (* :> Capture' mods sym v) sub) :: * Source #

Methods

toLink :: Proxy ((* :> Capture' mods sym v) sub) endpoint -> Link -> MkLink ((* :> Capture' mods sym v) sub) endpoint Source #

type MkLink * ((:>) * (Capture' mods sym v) sub) Source # 
type MkLink * ((:>) * (Capture' mods sym v) sub) = v -> MkLink * sub

data CaptureAll (sym :: Symbol) (a :: *) Source #

Capture all remaining values from the request path under a certain type a.

Example:

>>> -- GET /src/*
>>> type MyAPI = "src" :> CaptureAll "segments" Text :> Get '[JSON] SourceFile

Instances

(ToHttpApiData v, HasLink * sub) => HasLink * ((:>) * (CaptureAll sym v) sub) Source # 

Associated Types

type MkLink ((* :> CaptureAll sym v) sub) (endpoint :: (* :> CaptureAll sym v) sub) :: * Source #

Methods

toLink :: Proxy ((* :> CaptureAll sym v) sub) endpoint -> Link -> MkLink ((* :> CaptureAll sym v) sub) endpoint Source #

type MkLink * ((:>) * (CaptureAll sym v) sub) Source # 
type MkLink * ((:>) * (CaptureAll sym v) sub) = [v] -> MkLink * sub