@@ -30,6 +30,7 @@
30-- > {-# LANGUAGE OverloadedStrings #-}
30-- > {-# LANGUAGE OverloadedStrings #-}
31-- > {-# LANGUAGE TypeOperators #-}
31-- > {-# LANGUAGE TypeOperators #-}
32-- > {-# OPTIONS_GHC -fno-warn-orphans #-}
32-- > {-# OPTIONS_GHC -fno-warn-orphans #-}
33+-- > import Control.Lens
33-- > import Data.Aeson
34-- > import Data.Aeson
34-- > import Data.Proxy
35-- > import Data.Proxy
35-- > import Data.String.Conversions
36-- > import Data.String.Conversions
@@ -51,7 +52,7 @@
52-- > -- | We can also implement 'MimeRender' for additional formats like 'PlainText'.
53-- > -- | We can also implement 'MimeRender' for additional formats like 'PlainText'.
53-- > instance MimeRender PlainText Greet where
54-- > instance MimeRender PlainText Greet where
54−-- > toByteString Proxy (Greet s) = "\"" <> cs s <> "\""
55+-- > mimeRender Proxy (Greet s) = "\"" <> cs s <> "\""
56-- > -- We add some useful annotations to our captures,
57-- > -- We add some useful annotations to our captures,
57-- > -- query parameters and request body to make the docs
58-- > -- query parameters and request body to make the docs
@@ -111,7 +112,7 @@
111-- > :<|> "greet" :> ReqBody '[JSON] Greet :> Post '[JSON] Greet
112-- > :<|> "greet" :> ReqBody '[JSON] Greet :> Post '[JSON] Greet
113-- > -- DELETE /greet/:greetid
114-- > -- DELETE /greet/:greetid
114−-- > :<|> "greet" :> Capture "greetid" Text :> Delete
115+-- > :<|> "greet" :> Capture "greetid" Text :> Delete '[JSON] ()
116-- > testApi :: Proxy TestApi
117-- > testApi :: Proxy TestApi
117-- > testApi = Proxy
118-- > testApi = Proxy
@@ -121,7 +122,7 @@
121-- > -- notes.
122-- > -- notes.
122-- > extra :: ExtraInfo TestApi
123-- > extra :: ExtraInfo TestApi
123-- > extra =
124-- > extra =
124−-- > extraInfo (Proxy :: Proxy ("greet" :> Capture "greetid" Text :> Delete)) $
125+-- > extraInfo (Proxy :: Proxy ("greet" :> Capture "greetid" Text :> Delete '[JSON] ())) $
125-- > defAction & headers <>~ ["unicorns"]
126-- > defAction & headers <>~ ["unicorns"]
126-- > & notes <>~ [ DocNote "Title" ["This is some text"]
127-- > & notes <>~ [ DocNote "Title" ["This is some text"]
127-- > , DocNote "Second secton" ["And some more"]
128-- > , DocNote "Second secton" ["And some more"]