File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,21 @@ module Servant.API.WithNamedConfig where
5
5
6
6
import GHC.TypeLits
7
7
8
+ -- | 'WithNamedConfig' names a specific tagged configuration to use for the
9
+ -- combinators in the API. For example:
10
+ --
11
+ -- > type UseNamedConfigAPI1 = WithNamedConfig "myConfig" '[String] (
12
+ -- > ReqBody '[JSON] Int :> Get '[JSON] Int)
13
+ --
14
+ -- Both the 'ReqBody' and 'Get' combinators will use the 'NamedConfig' with
15
+ -- type tag "myConfig" as their configuration. In constrast, in (notice
16
+ -- parentesizing):
17
+ --
18
+ -- > type UseNamedConfigAPI2 = WithNamedConfig "myConfig" '[String] (
19
+ -- > ReqBody '[JSON] Int) :> Get '[JSON] Int
20
+ --
21
+ -- Only the 'ReqBody' combinator will use this configuration, and 'Get' will
22
+ -- maintain the default configuration.
23
+ --
24
+ -- For more information, see the tutorial.
8
25
data WithNamedConfig (name :: Symbol ) (subConfig :: [* ]) subApi
You can’t perform that action at this time.
0 commit comments