@@ -5,4 +5,21 @@ module Servant.API.WithNamedConfig where
55
66import GHC.TypeLits
77
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.
825data WithNamedConfig (name :: Symbol) (subConfig :: [*]) subApi